You've already forked pyinstxtractor
mirror of
https://github.com/extremecoders-re/pyinstxtractor.git
synced 2025-08-03 00:25:51 +08:00
Save embedded packages and modules with pyc extension
This commit is contained in:
@@ -248,9 +248,17 @@ class PyInstArchive:
|
|||||||
assert len(data) == entry.uncmprsdDataSize # Sanity Check
|
assert len(data) == entry.uncmprsdDataSize # Sanity Check
|
||||||
|
|
||||||
if entry.typeCmprsData == b's':
|
if entry.typeCmprsData == b's':
|
||||||
|
# s -> ARCHIVE_ITEM_PYSOURCE
|
||||||
# Entry point are expected to be python scripts
|
# Entry point are expected to be python scripts
|
||||||
print('[+] Possible entry point: {0}.pyc'.format(entry.name))
|
print('[+] Possible entry point: {0}.pyc'.format(entry.name))
|
||||||
self._writePyc(entry.name + '.pyc', data)
|
self._writePyc(entry.name + '.pyc', data)
|
||||||
|
|
||||||
|
elif entry.typeCmprsData == b'M' or entry.typeCmprsData == b'm':
|
||||||
|
# M -> ARCHIVE_ITEM_PYPACKAGE
|
||||||
|
# m -> ARCHIVE_ITEM_PYMODULE
|
||||||
|
# packages and modules are pyc files with their header's intact
|
||||||
|
with open(entry.name + '.pyc', 'wb') as f:
|
||||||
|
f.write(data)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
with open(entry.name, 'wb') as f:
|
with open(entry.name, 'wb') as f:
|
||||||
|
Reference in New Issue
Block a user