You've already forked pyinstxtractor
mirror of
https://github.com/extremecoders-re/pyinstxtractor.git
synced 2025-08-02 16:24:45 +08:00
Correct handling order of runtime options, followup #44
This commit is contained in:
@@ -275,12 +275,6 @@ class PyInstArchive:
|
||||
os.chdir(extractionDir)
|
||||
|
||||
for entry in self.tocList:
|
||||
basePath = os.path.dirname(entry.name)
|
||||
if basePath != '':
|
||||
# Check if path exists, create if not
|
||||
if not os.path.exists(basePath):
|
||||
os.makedirs(basePath)
|
||||
|
||||
self.fPtr.seek(entry.position, os.SEEK_SET)
|
||||
data = self.fPtr.read(entry.cmprsdDataSize)
|
||||
|
||||
@@ -290,6 +284,18 @@ class PyInstArchive:
|
||||
# Comment out the assertion in such a case
|
||||
assert len(data) == entry.uncmprsdDataSize # Sanity Check
|
||||
|
||||
if entry.typeCmprsData == b'd' or entry.typeCmprsData == b'o':
|
||||
# d -> ARCHIVE_ITEM_DEPENDENCY
|
||||
# o -> ARCHIVE_ITEM_RUNTIME_OPTION
|
||||
# These are runtime options, not files
|
||||
continue
|
||||
|
||||
basePath = os.path.dirname(entry.name)
|
||||
if basePath != '':
|
||||
# Check if path exists, create if not
|
||||
if not os.path.exists(basePath):
|
||||
os.makedirs(basePath)
|
||||
|
||||
if entry.typeCmprsData == b's':
|
||||
# s -> ARCHIVE_ITEM_PYSOURCE
|
||||
# Entry point are expected to be python scripts
|
||||
@@ -302,12 +308,6 @@ class PyInstArchive:
|
||||
# packages and modules are pyc files with their header's intact
|
||||
self._writeRawData(entry.name + '.pyc', data)
|
||||
|
||||
elif entry.typeCmprsData == b'd' or entry.typeCmprsData == b'o':
|
||||
# d -> ARCHIVE_ITEM_DEPENDENCY
|
||||
# o -> ARCHIVE_ITEM_RUNTIME_OPTION
|
||||
# These are runtime options, not files
|
||||
pass
|
||||
|
||||
else:
|
||||
self._writeRawData(entry.name, data)
|
||||
|
||||
|
Reference in New Issue
Block a user