-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathVS-Revisioned-Installer.py
527 lines (375 loc) · 18 KB
/
VS-Revisioned-Installer.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
import sys
from time import sleep
import base64
from winreg import OpenKey, HKEY_CURRENT_USER, QueryValueEx, CloseKey
import requests
import zipfile
from tqdm import tqdm
from shutil import copy2, rmtree
from os import makedirs, walk, rmdir, remove, getenv, getcwd, system, path, listdir
from re import search, findall
directory = getcwd()
def find_game_path(game_name):
drives = ['A:\\', 'B:\\', 'C:\\', 'D:\\', 'E:\\', 'F:\\', 'G:\\', 'H:\\', 'I:\\', 'J:\\', 'K:\\', 'L:\\', 'M:\\', 'N:\\', 'O:\\', 'P:\\', 'Q:\\', 'R:\\', 'S:\\', 'T:\\', 'U:\\', 'V:\\', 'W:\\', 'X:\\', 'Y:\\', 'Z:\\']
for drive in drives:
try:
root_dirs = listdir(drive)
for root_dir in root_dirs:
candidate_path = path.join(drive, root_dir, "steamapps", "common", game_name)
if path.exists(candidate_path):
return candidate_path.replace('/', '\\')
except (PermissionError, FileNotFoundError):
# Ignore any permission or file not found errors and continue to the next drive
pass
return None
game_name = "VampireSlayerTheResurrection"
game_path = find_game_path(game_name)
if game_path:
print("Game installation path:", game_path)
pak_path = path.join(game_path.strip(), "ISZ", "Content")
exe_path = path.join(game_path.strip(), "ISZ", "Binaries", "Win64")
if game_path == None:
def get_steam_game_path(game_name):
try:
steam_key = OpenKey(HKEY_CURRENT_USER, r"Software\Valve\Steam")
steam_install_path = QueryValueEx(steam_key, "SteamPath")[0]
game_vdf_path = path.join(steam_install_path, "steamapps", "appmanifest_{}.acf".format(game_name))
with open(game_vdf_path, 'r') as f:
content = f.read()
start_index = content.find('"installdir"') + 13
end_index = content.find('"', start_index)
game_install_dir = content[start_index:end_index]
game_path = path.join(steam_install_path, "steamapps", "common", game_install_dir)
return game_path.replace('/', '\\') # Replace forward slashes with backslashes
except FileNotFoundError:
return None
game_name = "2188960" # AppID
game_path = get_steam_game_path(game_name)
if game_path:
print("Game installation path:", game_path)
pak_path = path.join(game_path.strip(), "VampireSlayerTheResurrection", "ISZ", "Content")
exe_path = path.join(game_path.strip(), "VampireSlayerTheResurrection", "ISZ", "Binaries", "Win64")
if game_path == None:
print("Unable To Find Vampire Slayer: The Resurrection Installation Path.")
print("When Providing Directory please Inlcude the Folder 'VampireSlayerTheResurrection'.")
game_path = input("Please Type Installation Path: ")
if "\\VampireSlayerTheResurrection" in game_path:
pak_path = path.join(game_path.strip(), "ISZ", "Content")
exe_path = path.join(game_path.strip(), "ISZ", "Binaries", "Win64")
else:
print("Not A Valid Directory. Please Re-Input the Install Directory. Or Reinstall the Game.")
sleep(3)
system('clear')
get_steam_game_path()
def get_steam32_id():
try:
# Read the Steam configuration file
with open(r"C:\Program Files (x86)\Steam\config\config.vdf", "r") as file:
content = file.read()
# Use regular expressions to extract the Steam64 ID
match = search(r'"SteamID"\s+"(\d+)"', content)
if match:
steam64_id = match.group(1)
steam32_id = steam64_to_steam32(steam64_id)
return steam32_id
return None
except Exception as e:
return None
def steam64_to_steam32(steam64_id):
steam32_id = int(steam64_id) - 76561197960265728
return steam32_id
# Call the function to retrieve the Steam32 ID
steam32_id = get_steam32_id()
if steam32_id:
print(" ")
else:
if path.exists("Windows\\sysWOW64"):
print("Steam32 ID Doesn't Exist. Assumption of Pirated or Cracked Copy.")
print("If you think this is an Error, or Are getting this Message Wrongfully.")
print("Please report it here: 'https://github.com/ISZ-Hacker-Organization/VS-Revisioned-Installer/issues' Thank You.")
sleep(9)
exit()
else:
print("Operating System Isn't Windows-NT or 9X. Mod is Uncompatible with Linux and Unix Systems.")
sleep(4)
exit()
def read_numerical_digits():
try:
# Get the local AppData directory
appdata_dir = getenv('LOCALAPPDATA')
# Construct the full file path
file_path = path.join(appdata_dir, 'VS', 'Saved', 'SaveGames', 'steam_autocloud.vdf')
with open(file_path, "r") as file:
lines = file.readlines()
# Extract numerical digits from the third line using regular expressions
third_line = lines[2].strip() # Access the third line and remove leading/trailing whitespaces
digits = findall(r'\d+', third_line)
# Combine the digits into a single string
result = ''.join(digits)
result = int(result)
return result
except Exception as e:
print("Error reading SteamAppID digits:", e)
return None
# Call the function to read numerical digits
numerical_digits = read_numerical_digits()
var_steamid = steam32_id + 76561197960265728
if numerical_digits:
if numerical_digits == steam32_id:
print(f"Verification Passed Successfully '{numerical_digits} = {var_steamid}'.")
print(" ")
else:
print("Unable To Verify Legitimate Copy.")
print("If you think this is an Error, or Are getting this Message Wrongfully.")
print("Please report it here: 'https://github.com/ISZ-Hacker-Organization/VS-Revisioned-Installer/issues' Thank You.")
sleep(9)
url = 'https://github.com/Cracko298/VS-Revisioned/releases/download/v0.1-alpha-1/Single_Player.zip'
response = requests.get(url, stream=True)
total_size = int(response.headers.get('content-length', 0))
# Create a tqdm instance with the total file size
progress_bar = tqdm(total=total_size, unit='B', unit_scale=True)
# Download the file in chunks and update the progress bar
with open('SinglePlayerMod.zip', 'wb') as file:
for chunk in response.iter_content(chunk_size=1024):
if chunk:
file.write(chunk)
progress_bar.update(len(chunk))
# Close the progress bar
progress_bar.close()
url = 'https://github.com/Cracko298/VS-Revisioned/releases/download/v0.1-alpha-1/0xDBA2149AE61C394EEACE1D4CC8C9F9767C74D2401A7DFA29C5923AEDEC11ED49.key.txt'
response = requests.get(url, stream=True)
total_size = int(response.headers.get('content-length', 0))
# Create a tqdm instance with the total file size
progress_bar = tqdm(total=total_size, unit='B', unit_scale=True)
# Download the file in chunks and update the progress bar
with open('0xDBA2149AE61C394EEACE1D4CC8C9F9767C74D2401A7DFA29C5923AEDEC11ED49', 'wb') as file:
for chunk in response.iter_content(chunk_size=1024):
if chunk:
file.write(chunk)
progress_bar.update(len(chunk))
# Close the progress bar
progress_bar.close()
url = 'https://github.com/Cracko298/VS-Revisioned/releases/download/v0.1-alpha-1/server_c.txt'
response = requests.get(url, stream=True)
total_size = int(response.headers.get('content-length', 0))
# Create a tqdm instance with the total file size
progress_bar = tqdm(total=total_size, unit='B', unit_scale=True)
# Download the file in chunks and update the progress bar
with open('server_c', 'wb') as file:
for chunk in response.iter_content(chunk_size=1024):
if chunk:
file.write(chunk)
progress_bar.update(len(chunk))
# Close the progress bar
progress_bar.close()
url = 'https://github.com/Cracko298/VS-Revisioned/releases/download/v0.1-alpha-1/dxgi.dll'
response = requests.get(url, stream=True)
total_size = int(response.headers.get('content-length', 0))
# Create a tqdm instance with the total file size
progress_bar = tqdm(total=total_size, unit='B', unit_scale=True)
# Download the file in chunks and update the progress bar
with open('dxgi.dll', 'wb') as file:
for chunk in response.iter_content(chunk_size=1024):
if chunk:
file.write(chunk)
progress_bar.update(len(chunk))
# Close the progress bar
progress_bar.close()
url = 'https://github.com/Cracko298/VS-Revisioned/releases/download/v0.1-alpha-1/ISZ-Win64-Shipping-Patch.I2plg'
response = requests.get(url, stream=True)
total_size = int(response.headers.get('content-length', 0))
# Create a tqdm instance with the total file size
progress_bar = tqdm(total=total_size, unit='B', unit_scale=True)
# Download the file in chunks and update the progress bar
with open('ISZ-Win64-Shipping.exe', 'wb') as file:
for chunk in response.iter_content(chunk_size=1024):
if chunk:
file.write(chunk)
progress_bar.update(len(chunk))
# Close the progress bar
progress_bar.close()
url = 'https://github.com/Cracko298/VS-Revisioned/releases/download/v0.1-alpha-1/UnrealModUnlocker.dll'
response = requests.get(url, stream=True)
total_size = int(response.headers.get('content-length', 0))
# Create a tqdm instance with the total file size
progress_bar = tqdm(total=total_size, unit='B', unit_scale=True)
# Download the file in chunks and update the progress bar
with open('UnrealModUnlocker.dll', 'wb') as file:
for chunk in response.iter_content(chunk_size=1024):
if chunk:
file.write(chunk)
progress_bar.update(len(chunk))
# Close the progress bar
progress_bar.close()
url = 'https://github.com/Cracko298/VS-Revisioned/releases/download/v0.1-alpha-1/_mod.dll'
response = requests.get(url, stream=True)
total_size = int(response.headers.get('content-length', 0))
# Create a tqdm instance with the total file size
progress_bar = tqdm(total=total_size, unit='B', unit_scale=True)
# Download the file in chunks and update the progress bar
with open('_mod.dll', 'wb') as file:
for chunk in response.iter_content(chunk_size=1024):
if chunk:
file.write(chunk)
progress_bar.update(len(chunk))
# Close the progress bar
progress_bar.close()
url = 'https://github.com/Cracko298/VS-Revisioned-Files/releases/download/v0.1-alpha-1/ISZ-Win64-Shipping.profile'
response = requests.get(url, stream=True)
total_size = int(response.headers.get('content-length', 0))
# Create a tqdm instance with the total file size
progress_bar = tqdm(total=total_size, unit='B', unit_scale=True)
# Download the file in chunks and update the progress bar
with open('ISZ-Win64-Shipping.profile', 'wb') as file:
for chunk in response.iter_content(chunk_size=1024):
if chunk:
file.write(chunk)
progress_bar.update(len(chunk))
# Close the progress bar
progress_bar.close()
url = 'https://github.com/Cracko298/VS-Revisioned-Files/releases/download/v0.1-alpha-1/ModLoaderInfo.ini'
response = requests.get(url, stream=True)
total_size = int(response.headers.get('content-length', 0))
# Create a tqdm instance with the total file size
progress_bar = tqdm(total=total_size, unit='B', unit_scale=True)
# Download the file in chunks and update the progress bar
with open('ModLoaderInfo.ini', 'wb') as file:
for chunk in response.iter_content(chunk_size=1024):
if chunk:
file.write(chunk)
progress_bar.update(len(chunk))
# Close the progress bar
progress_bar.close()
url = 'https://github.com/Cracko298/VS-Revisioned-Files/releases/download/v0.1-alpha-1/UnrealEngineModLoader.dll'
response = requests.get(url, stream=True)
total_size = int(response.headers.get('content-length', 0))
# Create a tqdm instance with the total file size
progress_bar = tqdm(total=total_size, unit='B', unit_scale=True)
# Download the file in chunks and update the progress bar
with open('UnrealEngineModLoader.dll', 'wb') as file:
for chunk in response.iter_content(chunk_size=1024):
if chunk:
file.write(chunk)
progress_bar.update(len(chunk))
# Close the progress bar
progress_bar.close()
url = 'https://github.com/Cracko298/VS-Revisioned-Files/releases/download/v0.1-alpha-1/xinput1_3.dll'
response = requests.get(url, stream=True)
total_size = int(response.headers.get('content-length', 0))
# Create a tqdm instance with the total file size
progress_bar = tqdm(total=total_size, unit='B', unit_scale=True)
# Download the file in chunks and update the progress bar
with open('xinput1_3.dll', 'wb') as file:
for chunk in response.iter_content(chunk_size=1024):
if chunk:
file.write(chunk)
progress_bar.update(len(chunk))
# Close the progress bar
progress_bar.close()
url = 'https://github.com/Cracko298/VS-Revisioned-Files/releases/download/v0.1-alpha-1/UnrealModUnlocker-Settings.ini'
response = requests.get(url, stream=True)
total_size = int(response.headers.get('content-length', 0))
# Create a tqdm instance with the total file size
progress_bar = tqdm(total=total_size, unit='B', unit_scale=True)
# Download the file in chunks and update the progress bar
with open('UnrealModUnlocker-Settings.ini', 'wb') as file:
for chunk in response.iter_content(chunk_size=1024):
if chunk:
file.write(chunk)
progress_bar.update(len(chunk))
# Close the progress bar
progress_bar.close()
print("Download(s) complete.")
print(" ")
import zipfile
from tqdm import tqdm
zip_path = 'SinglePlayerMod.zip'
extract_path = directory
try:
# Get the total number of files in the zip archive
with zipfile.ZipFile(zip_path, 'r') as zip_ref:
total_files = len(zip_ref.infolist())
# Open the zip file
with zipfile.ZipFile(zip_path, 'r') as zip_ref:
# Extract all contents to the specified path
extracted_files = []
with tqdm(total=total_files, unit='file') as pbar:
for file in zip_ref.infolist():
zip_ref.extract(file, extract_path)
extracted_files.append(file.filename)
pbar.update(1)
print("Extraction(s) complete.")
except zipfile.BadZipFile:
print("Error: The specified file is not a valid ZIP archive.")
except FileNotFoundError:
print(f"Error: File '{zip_path}' not found.")
remove(zip_path)
print(f"Pak File Directory: {pak_path}.")
print(f"Exe File Directory: {exe_path}.")
sleep(1.5)
plugin_path = path.join(exe_path,"UnrealModPlugins")
profile_path = path.join(plugin_path, "Profiles")
print(" ")
print(f"Installing Patch Into: {exe_path}.")
makedirs(plugin_path, exist_ok=True)
makedirs(profile_path, exist_ok=True)
file_list = [
("_mod.dll", path.join(plugin_path, path.basename("_mod.dll"))),
("UnrealModUnlocker.dll", path.join(plugin_path, path.basename("UnrealModUnlocker.dll"))),
("xinput1_3.dll", path.join(plugin_path, path.basename("xinput1_3.dll"))),
("UnrealEngineModLoader.dll", path.join(plugin_path, path.basename("UnrealEngineModLoader.dll"))),
("ISZ-Win64-Shipping.profile", path.join(profile_path, path.basename("ISZ-Win64-Shipping.profile"))),
("ModLoaderInfo.ini", path.join(plugin_path, path.basename("ModLoaderInfo.ini"))),
("0xDBA2149AE61C394EEACE1D4CC8C9F9767C74D2401A7DFA29C5923AEDEC11ED49", path.join(exe_path, path.basename("0xDBA2149AE61C394EEACE1D4CC8C9F9767C74D2401A7DFA29C5923AEDEC11ED49"))),
("UnrealModUnlocker-Settings.ini", path.join(exe_path, path.basename("UnrealModUnlocker-Settings.ini"))),
("dxgi.dll", path.join(exe_path, path.basename("dxgi.dll"))),
("server_c", path.join(exe_path, path.basename("server_c"))),
("ISZ-Win64-Shipping.exe", path.join(exe_path, path.basename("ISZ-Win64-Shipping.exe")))
]
for source_file, destination_file in tqdm(file_list, desc="Copying Patch Files", unit="file"):
copy2(source_file, destination_file)
mod_files = path.join(directory, "Single_Player")
sleep(1)
print(" ")
print(f"Installing Mod Into: {pak_path}.")
file_list = []
for root, dirs, files in walk(mod_files):
for file in files:
source_file = path.join(root, file)
relative_path = path.relpath(source_file, mod_files)
destination_file = path.join(pak_path, relative_path)
file_list.append((source_file, destination_file))
for source_file, destination_file in tqdm(file_list, desc="Copying Mod Files", unit="file"):
makedirs(path.dirname(destination_file), exist_ok=True)
copy2(source_file, destination_file)
sleep(1)
print(" ")
print(f"Removing Temp Files.")
file_paths = [
path.join(directory, "_mod.dll"),
path.join(directory, "UnrealModUnlocker.dll"),
path.join(directory, "0xDBA2149AE61C394EEACE1D4CC8C9F9767C74D2401A7DFA29C5923AEDEC11ED49"),
path.join(directory, "dxgi.dll"),
path.join(directory, "server_c"),
path.join(directory, "ISZ-Win64-Shipping.exe"),
path.join(directory, "UnrealModUnlocker-Settings.ini"),
path.join(directory, "ISZ-Win64-Shipping.profile"),
path.join(directory, "ModLoaderInfo.ini"),
path.join(directory, "UnrealEngineModLoader.dll"),
path.join(directory, "xinput1_3.dll"),
]
for file_path in tqdm(file_paths, desc="Removing files", unit="file"):
if path.isfile(file_path):
remove(file_path)
if path.exists(mod_files):
with tqdm(total=sum([len(files) for _, _, files in walk(mod_files)]), desc="Deleting Temp Directory", unit="file") as pbar:
try:
rmtree(mod_files)
pbar.update(81)
except Exception as e:
pbar.update(0)
pbar.close()
print(" ")
print("Installed 'VS: Revisioned' Successfully.")
print("Closing Window in '5' Seconds.")
sleep(5)