Skip to main content

解包 PyInstaller 生成的 .exe 程序(中文版)

Project description

PyInstxtractorCN (v1.0.9) 中文文档

=================================

项目仓库
========
源代码和最新版本请访问 GitHub:
https://github.com/jzm3/pyinstxtractorCN

概述
====
本工具是针对 PyInstaller 6.12.0 及更低版本生成的 Windows 可执行文件(.exe)的解包工具汉化版,支持提取以下内容:
- Python 字节码文件(.pyc)
- 资源文件(图片/配置文件等)
- 依赖库文件
- PYZ 压缩包内容

功能特性
========
- 全版本兼容:支持 PyInstaller 2.0 至 6.x 打包的文件
- 智能解压:自动处理 Zlib 压缩数据,保留加密文件原始内容
- 字节码修复:自动修复提取的 .pyc 文件头(适配 uncompyle6/decompyle3)
- 安全防护:自动过滤非法路径字符(示例:恶意/../路径 → 恶意__路径)
- 中文日志:完整汉化的错误提示和进度信息
- 自定义输出路径:支持指定任意解包目录,自动创建不存在的路径
- 进度同步:与GUI版本实时同步解包进度,进度条显示更准确 [新增]

安装方式
========
通过 PyPI 安装:
pip install pyinstxtractorcn

手动运行:
1. 克隆仓库:
git clone https://github.com/jzm3/pyinstxtractorCN.git
2. 执行解包:
python pyinstxtractorCN/cli.py <目标文件.exe>

使用示例
========
基础命令:
pyinstxtractorcn 目标文件.exe

Python 调用:
import pyinstxtractorcn
pyinstxtractorcn.dcp('目标文件.exe')

高级用法:
控制台:
# Windows 指定绝对路径
pyinstxtractorcn 目标文件.exe --output "C:\\分析结果\\output"

# Linux/Mac 指定绝对路径
pyinstxtractorcn 目标文件.exe --output "/home/user/分析结果"

# 使用相对路径
pyinstxtractorcn 目标文件.exe --output "./output"

Python 调用:
# Windows 路径(原始字符串)
pyinstxtractorcn.dcp(r'C:\测试文件\目标文件.exe', output_dir=r'C:\分析结果\output')

# 跨平台路径(正斜杠)
pyinstxtractorcn.dcp('/tmp/测试文件/目标文件.exe', output_dir='/tmp/output')

# 带空格的路径处理
pyinstxtractorcn.dcp(r'C:\My Documents\测试文件.exe', output_dir=r'C:\分析结果\output')

反编译建议:
推荐工具组合:
- uncompyle6(Python 3.8 以下):https://pypi.org/project/uncompyle6/
- decompyle3(Python 3.9+):https://pypi.org/project/decompyle3/
- pycdc(跨版本反编译器):https://github.com/zrax/pycdc

注意事项
========
1. 版本匹配:建议使用与打包环境相同的 Python 版本运行本工具(支持 Python 3.6+)
2. 加密处理:
- 加密内容将保存为 .encrypted 文件
- 若出现 marshal.load 错误,请检查文件完整性
3. 路径规范:
- 空文件名会自动生成 UUID(如 9b4a8f2c.pyc)
- 自动转换非法路径字符(示例:恶意/../路径 → 恶意__路径)

技术支持
========
问题反馈渠道:
- 开发者邮箱:
pyinstxtractorcn@outlook.com
pyinstxtractorcn@163.com
- 提交 GitHub Issue:
https://github.com/jzm3/pyinstxtractorCN/issues

开源协议
========
本项目采用 GNU General Public License v3.0
完整协议文本请查看:
https://github.com/jzm3/pyinstxtractorCN/blob/main/LICENSE

【警告】
本工具仅限用于:
- 软件逆向工程研究
- 合法授权的安全审计
- 学术用途

禁止用于任何形式的商业破解或非法用途!使用者需自行承担法律责任。


PyInstxtractorCN (v1.0.9) English document
=========================

A Chinese-localized unpacking tool for PyInstaller-generated Windows executables.
Supports files built with PyInstaller 6.12.0 and earlier versions.

Project Repository
==================
GitHub: https://github.com/jzm3/pyinstxtractorCN

Features
========
- Full version compatibility (PyInstaller 2.0-6.x)
- Smart extraction with Zlib decompression
- Automatic .pyc header repair (compatible with uncompyle6/decompyle3)
- Path sanitization (e.g., "malicious/../path" → "malicious__path")
- Chinese localization (logs and prompts)
- Custom output path: Supports specifying any extraction directory with auto-creation
- Progress synchronization: Real time synchronization of unpacking progress with GUI version, more accurate display of progress bar [newly added]

Installation
============
Via PyPI:
pip install pyinstxtractorcn

Manual Execution:
1. Clone repository:
git clone https://github.com/jzm3/pyinstxtractorCN.git
2. Run unpacker:
python pyinstxtractorCN/cli.py <target.exe>

Usage Examples
==============
Basic command:
pyinstxtractorcn target.exe

Python API:
import pyinstxtractorcn
pyinstxtractorcn.dcp('target.exe')

Advanced usage:
Console:
# Windows absolute path
pyinstxtractorcn target.exe --output "C:\\analysis\\output"

# Linux/Mac absolute path
pyinstxtractorcn target.exe --output "/home/user/analysis"

# Relative path
pyinstxtractorcn target.exe --output "./output"

Python call:
# Windows path (raw string)
pyinstxtractorcn.dcp(r'C:\test_files\target.exe', output_dir=r'C:\analysis\output')

# Cross-platform path (forward slashes)
pyinstxtractorcn.dcp('/tmp/test_files/target.exe', output_dir='/tmp/output')

# Handle paths with spaces
pyinstxtractorcn.dcp(r'C:\My Documents\target.exe', output_dir=r'C:\analysis\output')

Output Structure
================
sample.exe_extracted/
├── PYZ-00.pyz_extracted/ # Dependency bytecode
├── pyiboot01_bootstrap/ # Bootloader files
├── _pytransform.dll # Encryption module (if present)
├── runtime/ # Runtime dependencies
└── sample.pyc # Main program bytecode

Decompilation Tools
===================
- uncompyle6 (Python <3.8): https://pypi.org/project/uncompyle6/
- decompyle3 (Python ≥3.9): https://pypi.org/project/decompyle3/
- pycdc (Cross-version): https://github.com/zrax/pycdc

Important Notes
===============
1. Python Version Matching
- Recommended to use same Python version as packing environment
- Supports Python 3.6+ runtime

2. Encrypted Files
- Encrypted content saved as .encrypted files
- Verify file integrity if marshal.load errors occur

3. Path Handling
- Auto-generate UUID for empty filenames (e.g., 9b4a8f2c.pyc)
- Sanitize illegal path characters

Technical Support
=================
Contact:
- Email: pyinstxtractorcn@outlook.com / pyinstxtractorcn@163.com
- GitHub Issues: https://github.com/jzm3/pyinstxtractorCN/issues

License
=======
GNU General Public License v3.0
Full text: https://github.com/jzm3/pyinstxtractorCN/blob/main/LICENSE

WARNING
=======
This tool is strictly for:
- Reverse engineering research
- Legally authorized security audits
- Academic purposes

Commercial cracking and illegal uses are prohibited. Users assume full legal responsibility.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyinstxtractorcn-1.1.0.tar.gz (12.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyinstxtractorcn-1.1.0-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

Details for the file pyinstxtractorcn-1.1.0.tar.gz.

File metadata

  • Download URL: pyinstxtractorcn-1.1.0.tar.gz
  • Upload date:
  • Size: 12.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for pyinstxtractorcn-1.1.0.tar.gz
Algorithm Hash digest
SHA256 c1e95505f4e83050468fc288069e880a24e8fc9e3f39acbaa4c7bde303244fe1
MD5 de03954996e0298bc3ff9f619ba17c2e
BLAKE2b-256 3afa416a31da4aa15ff1c87d36d6013810f8df1f920dbc586a44af47b8b87210

See more details on using hashes here.

File details

Details for the file pyinstxtractorcn-1.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pyinstxtractorcn-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4bef39ff557a71cee1496dece7363ed8076680bdfd7bcf475dab6e5abdb6c6d7
MD5 b4239f1e6553c702bf82dfdc1507fccb
BLAKE2b-256 3a5fafa7e9962f9dcc823807cfe80a390e3dde31bc2037adfc9518f382c1309a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page