From d8f092eb8022b5156141008fefdd8a07baa54dde Mon Sep 17 00:00:00 2001 From: zyb Date: Thu, 19 Jun 2025 13:16:46 +0800 Subject: [PATCH] modified: patch.py --- patch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/patch.py b/patch.py index 958ce44..75f085d 100644 --- a/patch.py +++ b/patch.py @@ -23,7 +23,7 @@ def replace_key(old,new,data,name=''): new_chunks = [bytes([new[i]]) for i in key_map] data = replace_chunks(old_chunks, new_chunks, data,name) - if 'ARCH' in os.environ and os.environ['ARCH'] == '-arm64': + if os.getenv('ARCH','') == '-arm64': old_chunks = [old[i:i+4] for i in range(0, len(old), 4)] new_chunks = [new[i:i+4] for i in range(0, len(new), 4)] old_bytes = old_chunks[4] + old_chunks[5] + old_chunks[2] + old_chunks[0] + old_chunks[1] + old_chunks[6] + old_chunks[7]