Pyinstaller Unpacker logo

Pyinstaller Unpacker

Community
ptn1411
pyinstaller-unpacker

Fully automated PyInstaller extraction and decompilation pipeline. Extracts .pyc from onefile/onedir bundles, fixes headers, and batch-decompiles with pycdc/uncompyle6/decompile3 fallback chain.

Overview

Publisherptn1411
Repositoryskill
Skill namepyinstaller-unpacker
Stars
275
Forks
133
Bundled files
3
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 3 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by ptn1411 on GitHub. Read the source before you install it.

Installation

Install the Pyinstaller Unpacker AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/ptn1411/skill/tree/main/pyinstaller-unpacker
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/ptn1411/skill.git /tmp/skill
mkdir -p .claude/skills
cp -r /tmp/skill/pyinstaller-unpacker .claude/skills/pyinstaller-unpacker
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Pyinstaller Unpacker in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Pyinstaller Unpacker on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Pyinstaller Unpacker is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

PyInstaller Unpacker & Decompiler

Extract and decompile Python source from PyInstaller-bundled executables (.exe/.elf).

Language rule: All skill instructions use English. Final summary presented to the user must be in Vietnamese.


0. Authorization & Routing

Operates under MASTER_POLICY.md §1-§2.

Sibling skillWhen
binary-identifierUpstream — confirms target is PyInstaller
nuitka-decryptorIf misidentified — Nuitka ≠ PyInstaller
writerpro-pentestDownstream — keygen from recovered source
javascript-deobfuscatorIf embedded Electron+PyInstaller hybrid

How PyInstaller Works

source.py → PyInstaller → CArchive → native bootloader + embedded .pyc/.pyz
                              ↓
              MEI magic marker at end of file: b'MEI\x0c\x0b\x0a\x0b\x0e'
              TOC (Table of Contents) lists all embedded files
              PYZ archive contains all imported modules as .pyc

Two modes:

  • Onefile: Single .exe with temp extraction at runtime. Everything in CArchive.
  • Onedir: Directory with main .exe + _internal/ folder containing .pyc/.pyd/.dll.

Key challenge: PyInstaller strips .pyc headers (first 16 bytes: magic + flags + timestamp + size). Must restore before decompilation.


Step 1 — Recon: Confirm PyInstaller

Look for these markers:

  • MEI magic at end of file (8 bytes)
  • Strings: _MEIPASS, _MEI, pyi_rth_, pyiboot
  • Section names or overlay data past PE end
bash
python scripts/unpack_pyinstaller.py --detect-only target.exe
powershell
python scripts\unpack_pyinstaller.py --detect-only target.exe

Step 2 — Extract .pyc Files

bash
python scripts/unpack_pyinstaller.py target.exe --out unpacked/
powershell
python scripts\unpack_pyinstaller.py target.exe --out unpacked\

What it does:

  1. Detect PyInstaller variant (onefile/onedir) and Python version
  2. If pyinstxtractor-ng available → use it (best compatibility)
  3. Fallback → manual CArchive parsing (built-in, no deps)
  4. Fix .pyc headers with correct magic number for detected Python version
  5. Extract PYZ archive (all imported modules)
  6. Write manifest.json listing all extracted files

Step 3 — Decompile .pyc to .py

bash
python scripts/decompile_pyc.py --pyc-dir unpacked/ --out decompiled/
powershell
python scripts\decompile_pyc.py --pyc-dir unpacked\ --out decompiled\

Fallback chain (version-aware):

Python versionPrimarySecondaryLast resort
3.9+pycdcdecompile3dis (bytecode)
3.6–3.8uncompyle6pycdcdis
3.5 and belowuncompyle6—dis

Step 4 — Verify & Analyze

bash
head -50 decompiled/main.py
grep -rn "api_key\|secret\|password\|token\|license" decompiled/

Workflow

1. DETECT    → unpack_pyinstaller.py --detect-only → confirm PyInstaller + version
2. EXTRACT   → unpack_pyinstaller.py → .pyc files + PYZ modules
3. DECOMPILE → decompile_pyc.py → .py source files
4. ANALYZE   → grep for secrets, license logic, endpoints
5. REPORT    → Present findings IN VIETNAMESE

Final Report to User (always in Vietnamese)

📦 Giải nén PyInstaller hoàn tất:

  🔍 Loại          : PyInstaller <onefile|onedir>
  🐍 Python        : <VERSION>
  📁 Files trích xuất: <COUNT> files
  📝 Decompile      : <SUCCESS>/<TOTAL> files thành công

  🔑 Phát hiện đáng chú ý:
    - <secrets, license logic, endpoints>

  💾 Output: decompiled/

  ▶ Bước tiếp theo:
    grep -rn "api_key\|secret" decompiled/

Anti-Patterns

❌ Don't✅ Do
Assume all Python exes are PyInstallerRun binary-identifier first — could be Nuitka, cx_Freeze, py2exe
Skip .pyc header fixPyInstaller strips headers — decompilers fail without them
Use only one decompilerVersion-aware fallback chain catches more files
Ignore PYZ archiveIt contains all imported modules — often more interesting than main script
Decompile without knowing Python versionMagic bytes differ per version — wrong header = wrong output

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Pyinstaller Unpacker AI skill do?

Fully automated PyInstaller extraction and decompilation pipeline. Extracts .pyc from onefile/onedir bundles, fixes headers, and batch-decompiles with pycdc/uncompyle6/decompile3 fallback chain.

Why use Pyinstaller Unpacker on TypingMind?

Because you install it once and use it with any model. Pyinstaller Unpacker is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Pyinstaller Unpacker in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/ptn1411/skill/tree/main/pyinstaller-unpacker. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Pyinstaller Unpacker?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Pyinstaller Unpacker?

As many as you like. As long as a model supports skills, you can use Pyinstaller Unpacker with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Pyinstaller Unpacker AI skill free?

It is published on GitHub by ptn1411. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇