extremecoders-re/pyinstxtractor

GitHub: extremecoders-re/pyinstxtractor

用于提取PyInstaller打包的可执行文件内容并自动修复pyc文件头以供反编译的Python脚本。

Stars: 4224 | Forks: 742

# PyInstaller Extractor PyInstaller Extractor 是一个用于提取 PyInstaller 生成的可执行文件内容的 Python 脚本。 pyc 文件的头部会自动修复,以便 Python 字节码反编译器能够识别它。该脚本可以在 Python 2.x 和 3.x 上运行。PyInstaller 版本 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, 6.14.1, 6.14.2, 6.15.0, 6.16.0, 6.17.0, 6.18.0, 6.19.0 均已[测试](https://github.com/pyinstxtractor/pyinstxtractor-test-binaries)并支持。可能也适用于其他版本。 该项目最初托管在 [SourceForge](https://sourceforge.net/projects/pyinstallerextractor/) 上。 ## 用法 通过将 exe 文件名作为参数传递来运行脚本。 ``` $ python pyinstxtractor.py X:\>python pyinstxtractor.py ``` 建议使用生成可执行文件时相同版本的 Python 来运行该脚本。这是为了在提取 PYZ 归档文件时防止反序列化错误(如果有的话)。 ## 示例 ``` X:\> python pyinstxtractor.py test.exe [+] Processing dist\test.exe [+] Pyinstaller version: 2.1+ [+] Python version: 36 [+] Length of package: 5612452 bytes [+] Found 59 files in CArchive [+] Beginning extraction...please standby [+] Possible entry point: pyiboot01_bootstrap.pyc [+] Possible entry point: test.pyc [+] Found 133 files in PYZ archive [+] Successfully extracted pyinstaller archive: dist\test.exe You can now use a python decompiler on the pyc files within the extracted directory ``` 提取 pyc 文件后,你可以使用 Python 反编译器,例如 [Uncompyle6](https://github.com/rocky/python-uncompyle6/) 和 [Decompyle++](https://github.com/zrax/pycdc)。 ``` X:\> uncompyle6.exe test.exe_extracted\test.pyc X:\> uncompyle6.exe test.exe_extracted\PYZ-00.pyz_extracted\__future__.pyc ``` ## 提取 Linux ELF 二进制文件 Pyinstxtractor 可以原生提取 Linux ELF 二进制文件,而无需其他工具。 有关其他问题和信息,请参阅 [Wiki](https://github.com/extremecoders-re/pyinstxtractor/wiki/Extracting-Linux-ELF-binaries) 和 [FAQ](https://github.com/extremecoders-re/pyinstxtractor/wiki/Frequently-Asked-Questions) ## 另请参阅 - [pyinstxtractor-ng](https://github.com/pyinstxtractor/pyinstxtractor-ng): pyinstxtractor 的独立二进制版本。该工具不需要 Python 即可运行,并且可以提取所有受支持的 PyInstaller 版本。它还支持加密的 pyinstaller 可执行文件。 - [pyinstxtractor-web](https://github.com/pyinstxtractor/pyinstxtractor-go): 在 Web 浏览器中运行的 pyinstxtractor,由 Go 和 GopherJS 提供支持。 ## 许可证 GNU General Public License v3.0
标签:CTF工具, DAST, Decompyle, EXE解析, PYC文件, PyInstaller, Python, Python 2, Python 3, Uncompyle6, URL提取, 云资产清单, 代码提取, 反编译, 字节码, 恶意软件分析, 文件解包, 无后门, 源码恢复, 漏洞搜索, 逆向工具, 逆向工程