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
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import subprocess
|
import subprocess
|
||||||
import argparse
|
import argparse
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
import struct
|
import struct
|
||||||
import code
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
@ -20,7 +18,8 @@ if __name__ == "__main__":
|
||||||
parser.add_argument("-v", "--disable-vigniette", action=argparse.BooleanOptionalAction, help="Disables the vigniette overlay.")
|
parser.add_argument("-v", "--disable-vigniette", action=argparse.BooleanOptionalAction, help="Disables the vigniette overlay.")
|
||||||
patch = parser.parse_args(patcher_args)
|
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 = f.read()
|
||||||
exe_hex = exe.hex()
|
exe_hex = exe.hex()
|
||||||
|
|
||||||
|
|
@ -43,15 +42,18 @@ if __name__ == "__main__":
|
||||||
"f30f590514a76e01f3440f5cc8f3450f5ecb",
|
"f30f590514a76e01f3440f5cc8f3450f5ecb",
|
||||||
"f30f590524b56e01f3440f5cc8f3450f5ecb"
|
"f30f590524b56e01f3440f5cc8f3450f5ecb"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
patched_exe_dir = Path("./er-patcher-tmp")
|
||||||
|
if not patched_exe_dir.is_dir():
|
||||||
|
patched_exe_dir.mkdir()
|
||||||
|
|
||||||
patched_exe = bytes.fromhex(exe_hex)
|
with open(patched_exe_dir / exe_name, "wb") as f:
|
||||||
patched_exe_path = Path("eldenring.patched.exe")
|
f.write(bytes.fromhex(exe_hex))
|
||||||
with open(patched_exe_path, "wb") as f:
|
|
||||||
f.write(patched_exe)
|
|
||||||
|
|
||||||
# start patched exe directly to avoid EAC
|
# start patched exe directly to avoid EAC
|
||||||
steam_cmd = sys.argv[1 + sys.argv.index("--"):]
|
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)
|
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