mirror of
https://github.com/gurrgur/er-patcher.git
synced 2026-06-13 09:47:54 +00:00
avoid renaming the patched executable to enable vkd3d-proton performance workarounds
This commit is contained in:
parent
04d5389175
commit
cb1a7d5fd2
1 changed files with 11 additions and 9 deletions
20
er-patcher
20
er-patcher
|
|
@ -1,13 +1,11 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
|
||||
import os
|
||||
import sys
|
||||
import subprocess
|
||||
import argparse
|
||||
from pathlib import Path
|
||||
import struct
|
||||
import code
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
|
@ -20,7 +18,8 @@ if __name__ == "__main__":
|
|||
parser.add_argument("-v", "--disable-vigniette", action=argparse.BooleanOptionalAction, help="Disables the vigniette overlay.")
|
||||
patch = parser.parse_args(patcher_args)
|
||||
|
||||
with open(Path("eldenring.exe"), "rb") as f:
|
||||
exe_name = Path("eldenring.exe")
|
||||
with open(exe_name, "rb") as f:
|
||||
exe = f.read()
|
||||
exe_hex = exe.hex()
|
||||
|
||||
|
|
@ -44,14 +43,17 @@ if __name__ == "__main__":
|
|||
"f30f590524b56e01f3440f5cc8f3450f5ecb"
|
||||
)
|
||||
|
||||
patched_exe = bytes.fromhex(exe_hex)
|
||||
patched_exe_path = Path("eldenring.patched.exe")
|
||||
with open(patched_exe_path, "wb") as f:
|
||||
f.write(patched_exe)
|
||||
patched_exe_dir = Path("./er-patcher-tmp")
|
||||
if not patched_exe_dir.is_dir():
|
||||
patched_exe_dir.mkdir()
|
||||
|
||||
with open(patched_exe_dir / exe_name, "wb") as f:
|
||||
f.write(bytes.fromhex(exe_hex))
|
||||
|
||||
# start patched exe directly to avoid EAC
|
||||
steam_cmd = sys.argv[1 + sys.argv.index("--"):]
|
||||
steam_cmd[-1] = steam_cmd[-1].replace("start_protected_game", "eldenring.patched")
|
||||
steam_cmd[-1] = Path(steam_cmd[-1]).parent.absolute() / patched_exe_dir / exe_name
|
||||
subprocess.run(steam_cmd)
|
||||
|
||||
os.remove(patched_exe_path)
|
||||
os.remove(patched_exe_dir / exe_name)
|
||||
os.rmdir(patched_exe_dir)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue