Skip to content

Commit

Permalink
Avoid making the same check twice.
Browse files Browse the repository at this point in the history
  • Loading branch information
Lattyware committed May 24, 2018
1 parent fa5677f commit ec1033b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion unrpa
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ class UnRPA:

with open(self.archive, "rb") as f:
offset = 0
key = None
if self.version == 2:
offset = int(f.readline()[8:], 16)
elif self.version == 3:
Expand All @@ -108,7 +109,7 @@ class UnRPA:
key = int(parts[2], 16)
f.seek(offset)
index = pickle.loads(zlib.decompress(f.read()), encoding="bytes")
if self.version == 3:
if key is not None:
index = self.deobfuscate_index(index, key)

return {self.ensure_str_path(path).replace("/", os.sep): data for path, data in index.items()}
Expand Down

0 comments on commit ec1033b

Please sign in to comment.