From e20bb033f6bfbb047ed5a5275fc3c717ffe53025 Mon Sep 17 00:00:00 2001 From: able Date: Mon, 7 Mar 2022 00:27:21 +0800 Subject: [PATCH 1/2] Sometimes, the split file number starts at 0 --- UnityPy/environment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UnityPy/environment.py b/UnityPy/environment.py index bfbeca6f..8b5f35ff 100644 --- a/UnityPy/environment.py +++ b/UnityPy/environment.py @@ -64,7 +64,7 @@ def load_files(self, files: list): for basepath in splits: # merge data data = io.BytesIO() - for i in range(1, 999): + for i in range(0, 999): item = f"{basepath}.split{i}" if os.path.exists(item): with open(item, "rb") as f: From f5c908ec2240e76e8ac58739aba5baf5c995583c Mon Sep 17 00:00:00 2001 From: Rudolf Kolbe Date: Thu, 10 Mar 2022 11:58:11 +0100 Subject: [PATCH 2/2] implement splitpath searching from 0 in apks and don't break default case --- UnityPy/environment.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/UnityPy/environment.py b/UnityPy/environment.py index 8b5f35ff..3dfec029 100644 --- a/UnityPy/environment.py +++ b/UnityPy/environment.py @@ -69,7 +69,7 @@ def load_files(self, files: list): if os.path.exists(item): with open(item, "rb") as f: data.write(f.read()) - else: + elif i: break self.files[self.reduce_path(basepath)] = self.load_file(data) @@ -159,12 +159,12 @@ def load_zip_file(self, value): for basepath in splits: # merge data data = io.BytesIO() - for i in range(1, 999): + for i in range(0, 999): item = f"{basepath}.split{i}" if item in z.namelist(): with z.open(item) as f: data.write(f.read()) - else: + elif i: break *path, name = basepath.split("/") cur = self