Skip to content

Commit

Permalink
allow user-code switch to extract pyc files
Browse files Browse the repository at this point in the history
  • Loading branch information
huettenhain committed Sep 28, 2024
1 parent 433f4d7 commit 22690fc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions refinery/units/formats/archive/xtpyi.py
Original file line number Diff line number Diff line change
Expand Up @@ -603,11 +603,12 @@ def unpack(self, data):
for position in positions:
self.log_info(F'magic signature found at offset 0x{position:0{width}X}')
self.log_warn(F'found {len(positions) - 1} potential PyInstaller epilogue markers; using last one.')
decompile = self.args.decompile or self.args.user_code
decompile = self.args.decompile
uc_target = PiType.USERCODE if decompile else PiType.SOURCE
archive = PyInstallerArchiveEpilogue(view, positions[-1], mode, decompile)
for name, file in archive.files.items():
if self.args.user_code:
if file.type != PiType.USERCODE:
if file.type != uc_target:
continue
if name.startswith('pyiboot'):
continue
Expand Down

0 comments on commit 22690fc

Please sign in to comment.