pyinstxtractor

extremecoders-reGPL-3.0活跃维护

从 PyInstaller 打包的 exe 中提取 pyc 文件,方便后续反编译还原 Python 源码,是逆向分析打包程序的第一步。

PyInstaller Extractor

2026.07发布于 2026-07-22 09:09 UTC4,522star +2 / 7 天760fork同步于 2026-11-10 17:39 UTC

怎么上手

由 README 提炼,执行前请确认
python pyinstxtractor.py <filename>
硬件要求按 README 说明

README 未说明,仅需能运行 Python 2.x 或 3.x 的环境

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

从 PyInstaller 打包的可执行文件中提取 pyc 和资源,方便后续反编译分析

从 PyInstaller 打包的 exe 中提取 pyc 文件,方便后续反编译还原 Python 源码,是逆向分析打包程序的第一步。

核心能力

  • 自动修复 pyc 文件头以便反编译器识别
  • 支持 Python 2.x 与 3.x 运行
  • 覆盖 PyInstaller 2.0 至 6.19.0 众多版本
  • 原生提取 Linux ELF 二进制无需其他工具
  • 输出 CArchive 与 PYZ 归档内全部文件

容易踩的坑

建议用与生成该可执行文件相同版本的 Python 运行,否则解包 PYZ 归档时可能出现 unmarshalling 错误;提取出的 pyc 需另装 Uncompyle6 或 Decompyle++ 等反编译器才能还原源码;不支持加密的 PyInstaller 可执行文件,需改用 pyinstxtractor-ng

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本2026.07
  1. 2026.07最新正式版2026-07-22 · 2026-07-22 09:09 UTC
  2. 2026.042026-04-07 · 2026-04-07 10:56 UTC
    查看更新说明
  3. 2025.022025-02-22 · 2025-02-22 10:00 UTC
    查看更新说明

    Bump release version

  4. 2024.042024-04-14 · 2024-04-14 06:20 UTC
    查看更新说明

    Bump release version

  5. 2023.122023-12-03 · 2023-12-03 18:20 UTC
    查看更新说明

    Bump release version

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    PyInstaller Extractor

    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, 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 are tested & supported. Probably will work with other versions too.

    This project was originally hosted on SourceForge.

    Usage

    The script can be run by passing the name of the exe as an argument.

    $ python pyinstxtractor.py <filename>
    X:\>python pyinstxtractor.py <filename>
    

    It is recommended to run the script in the same version of Python which was used to generate the executable. This is to prevent unmarshalling errors(if any) while extracting the PYZ archive.

    Example

    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
    

    After extracting the pyc's you can use a Python decompiler like Uncompyle6 and Decompyle++.

    X:\> uncompyle6.exe test.exe_extracted\test.pyc
    X:\> uncompyle6.exe test.exe_extracted\PYZ-00.pyz_extracted\__future__.pyc
    

    Extracting Linux ELF binaries

    Pyinstxtractor can natively extract Linux ELF binaries without requiring other tools.

    For other questions and information, please see the Wiki and the FAQ

    See also

    • pyinstxtractor-ng: A standalone binary version of pyinstxtractor. This tool doesn't require Python to run and can extract all supported versions of PyInstaller. It also supports encrypted pyinstaller executables.
    • pyinstxtractor-web: pyinstxtractor running in the web browser, powered by Go & GopherJS.

    License

    GNU General Public License v3.0