From 9dc4e6d6da2b7a57b076983bb2ce70340cd2ada5 Mon Sep 17 00:00:00 2001 From: Donal Cahill Date: Wed, 9 Mar 2022 03:30:31 +0000 Subject: [PATCH] fix: save memory --- er-patcher | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/er-patcher b/er-patcher index 6ce90c3..09c075a 100755 --- a/er-patcher +++ b/er-patcher @@ -23,8 +23,7 @@ if __name__ == "__main__": exe_name = Path("eldenring.exe") with open(exe_name, "rb") as f: - exe = f.read() - exe_hex = exe.hex() + exe_hex = f.read().hex() if patch.rate != 60 and patch.rate > 0: exe_hex = exe_hex.replace( @@ -71,6 +70,8 @@ if __name__ == "__main__": with open(patched_exe_dir / exe_name, "wb") as f: f.write(bytes.fromhex(exe_hex)) + del exe_hex + # start patched exe directly to avoid EAC steam_cmd = sys.argv[1 + sys.argv.index("--"):] steam_cmd[-1] = Path(steam_cmd[-1]).parent.absolute() / patched_exe_dir / exe_name