PyInstaller Extractor 是一个用于解包 PyInstaller 生成的独立可执行文件的工具。该工具无需安装 PyInstaller,脚本本身包含了所有必要功能。
PyInstaller Extractor is a tool for unpacking standalone executables generated by PyInstaller. This tool does not require PyInstaller installation as the script contains all necessary functionality.
-
支持 PyInstaller 3.2, 3.1, 3.0, 2.1, 2.0 版本
-
无需安装 PyInstaller
-
支持 Python 2.x 和 3.x
-
中英双语输出
-
自动处理加密的 PYZ 归档
-
支持 PYZ 归档中的子目录
-
Supports PyInstaller versions 3.2, 3.1, 3.0, 2.1, 2.0
-
No PyInstaller installation required
-
Compatible with both Python 2.x and 3.x
-
Bilingual output (English and Chinese)
-
Automatic handling of encrypted PYZ archives
-
Supports subdirectories in PYZ archives
- Python 2.6 或更高版本 / Python 2.6 or higher
- 建议使用与创建可执行文件时相同的 Python 版本运行此脚本 / It is recommended to run this script with the same Python version used to create the executable
- 将
pyinstxtractor2026.py脚本复制到可执行文件所在的目录 - 运行脚本并指定可执行文件名作为参数
Copy the pyinstxtractor2026.py script to the directory containing your executable
Run the script with the executable filename as a parameter
# Windows
python pyinstxtractor2026.py <filename.exe>
# Linux/Mac
python3 pyinstxtractor2026.py <filename># 提取指定文件 / Extract specified file
python pyinstxtractor2026.py your_program.exe
# 查看帮助 / View help
python pyinstxtractor2026.py脚本运行后,会在当前目录下创建一个名为 [可执行文件名]_extracted 的文件夹,其中包含所有解包的文件:
After running the script, a folder named [executable_filename]_extracted will be created in the current directory, containing all unpacked files:
-
原始文件 - 解包出的原始资源文件
-
PYZ 归档 - 包含 Python 字节码文件的归档
-
PYZ 提取内容 - 以
_extracted为后缀的文件夹,包含解包的.pyc文件 -
Original files - Unpacked original resource files
-
PYZ archives - Archives containing Python bytecode files
-
PYZ extracted contents - Folders with
_extractedsuffix containing unpacked.pycfiles
# 解包 myapp.exe / Unpack myapp.exe
python pyinstxtractor2026.py myapp.exe
# 输出目录 / Output directory
# myapp.exe_extracted/
# ├── myapp.exe.manifest
# ├── pyiboot01_bootstrap.pyc
# ├── pyimod01_os_path.pyc
# ├── ...
# └── PYZ-00.pyz_extracted/
# ├── __main__.pyc
# ├── module1.pyc
# └── ...如果遇到加密的 PYZ 归档,脚本会自动检测并以 .pyc.encrypted 扩展名保存文件,供后续处理。
If encrypted PYZ archives are encountered, the script automatically detects and saves files with .pyc.encrypted extension for subsequent processing.
A: 不同版本的 Python 可能使用不同的字节码格式,这可能导致解包 .pyc 文件时出现错误。使用相同版本可以确保最佳兼容性。
Q1: Why is it recommended to run the script with the same Python version?
A: Different Python versions may use different bytecode formats, which can cause errors when unpacking .pyc files. Using the same version ensures optimal compatibility.
A: 您可以使用以下工具之一:
- uncompyle6 - 支持 Python 2.7 和 3.2-3.8
- decompyle3 - 支持 Python 3.7-3.8
- pycdc - 支持多种 Python 版本
Q2: How to decompile extracted .pyc files?
A: You can use one of the following tools:
- uncompyle6 - Supports Python 2.7 and 3.2-3.8
- decompyle3 - Supports Python 3.7-3.8
- pycdc - Supports multiple Python versions
A: 这表示您的可执行文件使用的是脚本不支持的 PyInstaller 版本。请检查 PyInstaller 版本或考虑使用其他解包工具。
Q3: What to do if the script reports "Unsupported pyinstaller version"? A: This indicates that your executable uses a PyInstaller version not supported by the script. Check the PyInstaller version or consider using other unpacking tools.
- 修复在3.x.x版本时无法运行的问题 / Fix the issue that prevented running in version 3.x.x
- 添加zh-cn语言支持 / Add zh-CN language support
- 使用 importlib 替代已弃用的 imp 模块 / Use importlib to replace deprecated imp module
- 支持 PYZ 文件中的子目录 / Support for sub-directories in .pyz files
- 感谢 Moritz Kroll @ Avira Operations GmbH & Co. KG / Thanks to Moritz Kroll @ Avira Operations GmbH & Co. KG
- 使脚本兼容 Python 2.6 / Made the script compatible with python 2.6
- 支持 PyInstaller 3.2 / Added support for pyinstaller 3.2
- 提取未命名文件时使用随机名称 / Extractor will use a random name while extracting unnamed files
- 加密 PYZ 归档按原样转储 / For encrypted pyz archives it will dump the contents as is
- 支持 PyInstaller 3.1 / Added support for pyinstaller 3.1
- 修复写入 pyc 文件版本 >= 3.3 时的错误 / Fixed a bug when writing pyc files >= version 3.3
- 支持 PyInstaller 3.0 正式版 / Added support for pyinstaller 3.0 final
- 兼容 Python 2.x 和 3.x / Script is compatible with both python 2.x & 3.x
- 支持 PyInstaller 2.1 和 3.0 开发版 / Added support for pyinstaller 2.1 and 3.0 dev
- 代码清理 / Cleaned up code
- 更详细的输出 / Script is now more verbose
- 在专用子目录中提取可执行文件 / Executable extracted within a dedicated sub-directory
- 首次发布 / First Release
- 仅支持 PyInstaller 2.0 / Supports only pyinstaller 2.0
本项目根据 GNU General Public License (GPL) v3 许可证授权。
This project is licensed under the GNU General Public License (GPL) v3.
- Extreme Coders
- 邮箱 / Email: extremecoders(at)hotmail(dot)com
- 网站 / Web: https://0xec.blogspot.com
- Liu Yu chen / 刘宇晨
- 邮箱 / Email: liuyuchen032901@outlook.com
-
本工具仅用于教育和合法逆向工程目的。
-
请确保您有权分析和修改目标可执行文件。
-
对于加密或混淆的可执行文件,可能需要额外步骤才能完全提取内容。
-
This tool is intended for educational and legitimate reverse engineering purposes only.
-
Ensure you have the right to analyze and modify the target executable.
-
For encrypted or obfuscated executables, additional steps may be required to fully extract content.
欢迎提交问题和改进建议。由于原始作者已不再维护此项目,请通过修改者的邮箱联系。
Issues and improvement suggestions are welcome. Since the original author is no longer maintaining this project, please contact the modifier via email.