17 Commits

Author SHA1 Message Date
extremecoders-re
9f005ddf22 Mention support for 6.13.0, 6.14.0 2025-06-04 03:31:34 +05:30
extremecoders-re
bb936f9b2c Mention support for 6.12.0 2025-02-22 15:28:28 +05:30
extremecoders-re
0e3ba85701 Mention support for 6.10.0, 6.11.0, 6.11.1 2024-11-12 22:40:46 +05:30
extremecoders-re
90974deaa6 Mention support for 6.7.0, 6.8.0, 6.9.0 2024-07-21 15:14:42 +05:30
extremecoders-re
7deea464e0 Mention support for pyinstaller 6.4.0, 6.5.0, 6.6.0 2024-04-14 11:48:14 +05:30
extremecoders-re
6c5040ec55 Mention support for pyinstaller 6.3.0 2024-01-20 18:06:02 +05:30
extremecoders-re
2457a39b67 Mention support for 6.1.0, 6.2.0 2023-12-03 23:49:07 +05:30
extremecoders-re
6be66895ba Fix Invalid escape sequence \p syntax warning 2023-12-03 23:47:41 +05:30
extremecoders-re
f1cff6b4cc Mention support for 5.13.1, 5.13.2, 6.0.0 2023-10-11 03:12:14 +05:30
extremecoders-re
9565295780 Backport non UTF-8 file name bugfix from pyinstxtractor-ng 2023-08-21 02:39:38 +05:30
extremecoders-re
4c89bd51db Mention support for 5.13.0 2023-08-19 14:00:49 +05:30
extremecoders-re
044812c1f0 Merge pull request #70 from maximevince/master
Do not abort after the first extraction error
2023-06-30 13:14:10 +05:30
Maxime Vincent
c19cdbb30f Do not abort after the first extraction error; continue with the next file instead 2023-06-30 08:51:02 +02:00
extremecoders-re
128cb962c0 Mention support for 5.11.0 and 5.12.0 2023-06-16 20:50:14 +05:30
extremecoders-re
5268087d25 Handle CArchive entries starting with an absolute file path, closes #67 2023-06-09 03:01:02 +05:30
extremecoders-re
cad8c74542 Mention support for 5.10.0, 5.10.1 2023-05-07 16:45:37 +05:30
extremecoders-re
389dbe53e5 Mention support for 5.9.0 2023-04-09 12:33:51 +05:30
2 changed files with 19 additions and 5 deletions

View File

@@ -2,7 +2,7 @@
PyInstaller Extractor is a Python script to extract the contents of a PyInstaller generated executable file. PyInstaller Extractor is a Python script to extract the contents of a PyInstaller generated executable file.
The header of the pyc files are automatically fixed so that a Python bytecode decompiler will recognize it. The script can run on both Python 2.x and 3.x. PyInstaller versions 2.0, 2.1, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 4.0, 4.1, 4.2, 4.3, 4.4, 4.5, 4.5.1, 4.6, 4.7, 4.8, 4.9, 4.10, 5.0, 5.0.1, 5.1, 5.2, 5.3, 5.4, 5.4.1, 5.5, 5.6, 5.6.1, 5.6.2, 5.7.0, 5.8.0 are [tested](https://github.com/pyinstxtractor/pyinstxtractor-test-binaries) & supported. Probably will work with other versions too. The header of the pyc files are automatically fixed so that a Python bytecode decompiler will recognize it. The script can run on both Python 2.x and 3.x. PyInstaller versions 2.0, 2.1, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 4.0, 4.1, 4.2, 4.3, 4.4, 4.5, 4.5.1, 4.6, 4.7, 4.8, 4.9, 4.10, 5.0, 5.0.1, 5.1, 5.2, 5.3, 5.4, 5.4.1, 5.5, 5.6, 5.6.1, 5.6.2, 5.7.0, 5.8.0, 5.9.0, 5.10.0, 5.10.1, 5.11.0, 5.12.0, 5.13.0, 5.13.1, 5.13.2, 6.0.0, 6.1.0, 6.2.0, 6.3.0, 6.4.0, 6.5.0, 6.6.0, 6.7.0, 6.8.0, 6.9.0, 6.10.0, 6.11.0, 6.11.1, 6.12.0, 6.13.0, 6.14.0 are [tested](https://github.com/pyinstxtractor/pyinstxtractor-test-binaries) & supported. Probably will work with other versions too.
This project was originally hosted on [SourceForge](https://sourceforge.net/projects/pyinstallerextractor/). This project was originally hosted on [SourceForge](https://sourceforge.net/projects/pyinstallerextractor/).

View File

@@ -1,5 +1,5 @@
""" """
PyInstaller Extractor v2.0 (Supports pyinstaller 5.8.0, 5.7.0, 5.6.2, 5.6.1, 5.6, 5.5, 5.4.1, 5.4, 5.3, 5.2, 5.1, 5.0.1, 5.0, 4.10, 4.9, 4.8, 4.7, 4.6, 4.5.1, 4.5, 4.4, 4.3, 4.2, 4.1, 4.0, 3.6, 3.5, 3.4, 3.3, 3.2, 3.1, 3.0, 2.1, 2.0) PyInstaller Extractor v2.0 (Supports pyinstaller 6.14.0, 6.13.0, 6.12.0, 6.11.1, 6.11.0, 6.10.0, 6.9.0, 6.8.0, 6.7.0, 6.6.0, 6.5.0, 6.4.0, 6.3.0, 6.2.0, 6.1.0, 6.0.0, 5.13.2, 5.13.1, 5.13.0, 5.12.0, 5.11.0, 5.10.1, 5.10.0, 5.9.0, 5.8.0, 5.7.0, 5.6.2, 5.6.1, 5.6, 5.5, 5.4.1, 5.4, 5.3, 5.2, 5.1, 5.0.1, 5.0, 4.10, 4.9, 4.8, 4.7, 4.6, 4.5.1, 4.5, 4.4, 4.3, 4.2, 4.1, 4.0, 3.6, 3.5, 3.4, 3.3, 3.2, 3.1, 3.0, 2.1, 2.0)
Author : Extreme Coders Author : Extreme Coders
E-mail : extremecoders(at)hotmail(dot)com E-mail : extremecoders(at)hotmail(dot)com
Web : https://0xec.blogspot.com Web : https://0xec.blogspot.com
@@ -20,7 +20,7 @@ extracting the PYZ archive.
Usage : Just copy this script to the directory where your exe resides Usage : Just copy this script to the directory where your exe resides
and run the script with the exe file name as a parameter and run the script with the exe file name as a parameter
C:\path\to\exe\>python pyinstxtractor.py <filename> C:\\path\\to\\exe\\>python pyinstxtractor.py <filename>
$ /path/to/exe/python pyinstxtractor.py <filename> $ /path/to/exe/python pyinstxtractor.py <filename>
Licensed under GNU General Public License (GPL) v3. Licensed under GNU General Public License (GPL) v3.
@@ -231,7 +231,17 @@ class PyInstArchive:
'!IIIBc{0}s'.format(entrySize - nameLen), \ '!IIIBc{0}s'.format(entrySize - nameLen), \
self.fPtr.read(entrySize - 4)) self.fPtr.read(entrySize - 4))
name = name.decode('utf-8').rstrip('\0') try:
name = name.decode("utf-8").rstrip("\0")
except UnicodeDecodeError:
newName = str(uniquename())
print('[!] Warning: File name {0} contains invalid bytes. Using random name {1}'.format(name, newName))
name = newName
# Prevent writing outside the extraction directory
if name.startswith("/"):
name = name.lstrip("/")
if len(name) == 0: if len(name) == 0:
name = str(uniquename()) name = str(uniquename())
print('[!] Warning: Found an unamed file in CArchive. Using random name {0}'.format(name)) print('[!] Warning: Found an unamed file in CArchive. Using random name {0}'.format(name))
@@ -274,7 +284,11 @@ class PyInstArchive:
data = self.fPtr.read(entry.cmprsdDataSize) data = self.fPtr.read(entry.cmprsdDataSize)
if entry.cmprsFlag == 1: if entry.cmprsFlag == 1:
data = zlib.decompress(data) try:
data = zlib.decompress(data)
except zlib.error:
print('[!] Error : Failed to decompress {0}'.format(entry.name))
continue
# Malware may tamper with the uncompressed size # Malware may tamper with the uncompressed size
# Comment out the assertion in such a case # Comment out the assertion in such a case
assert len(data) == entry.uncmprsdDataSize # Sanity Check assert len(data) == entry.uncmprsdDataSize # Sanity Check