Merge pull request #2 from DinCahill/fix/save-memory

fix: save memory
This commit is contained in:
gurrgur 2022-03-09 10:39:54 +01:00 committed by GitHub
commit 01a6e8e910
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -23,8 +23,7 @@ if __name__ == "__main__":
exe_name = Path("eldenring.exe") exe_name = Path("eldenring.exe")
with open(exe_name, "rb") as f: with open(exe_name, "rb") as f:
exe = f.read() exe_hex = f.read().hex()
exe_hex = exe.hex()
if patch.rate != 60 and patch.rate > 0: if patch.rate != 60 and patch.rate > 0:
exe_hex = exe_hex.replace( exe_hex = exe_hex.replace(
@ -71,6 +70,8 @@ if __name__ == "__main__":
with open(patched_exe_dir / exe_name, "wb") as f: with open(patched_exe_dir / exe_name, "wb") as f:
f.write(bytes.fromhex(exe_hex)) f.write(bytes.fromhex(exe_hex))
del exe_hex
# 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] = Path(steam_cmd[-1]).parent.absolute() / patched_exe_dir / exe_name steam_cmd[-1] = Path(steam_cmd[-1]).parent.absolute() / patched_exe_dir / exe_name