Logo: Ida Nuitka Reconstructor

Ida Nuitka Reconstructor

Communautéit
ptn1411
ida-nuitka-reconstructor

Rekonstruéiert Python-Quellcode aus mat Nuitka kompiléierte Binärdateien (.dll/.exe/.pyd), andeems serialiséiert Konstanten aus PE-.rsrc/.rdata-Sektiounen extrahéiert ginn an IDA Pro MCP fir eng Live-Dekompilatioun benotzt gëtt. Benotzt dëse Skill, wann d'Zil eng Nuitka-Onefile-/Standalone-Binärdatei ouni .encrypted-Dateie ass — Python gëtt a C kompiléiert, net verschlësselt.

Add to TypingMind

Iwwersiicht

Editeurptn1411
Repositoryskill
Skill-Nummida-nuitka-reconstructor
Stären
275
Forks
133
Matgeliwwert Dateien
4
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • 4 matgeliwwert Dateien

    Skripten, Virlagen a Referenzen, déi de Modell beim Schaffe liese kann. D'Dateie kënnen nëmme gelies ginn a ginn ni ausgeféiert.

  • Open Source

    ptn1411 huet de Skill op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Ida Nuitka Reconstructor an TypingMind, fir e mat all LLM ze benotzen, oder setzt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vu GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier, déi hei drënner steet, an a bestätegt d'Installatioun.
    https://github.com/ptn1411/skill/tree/main/ida-nuitka-reconstructor
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill derbäisetzen → Iwwer eng GitHub-URL. Pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an d'Skill-Verzeechnes vun deem KI-Agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/ptn1411/skill.git /tmp/skill
mkdir -p .claude/skills
cp -r /tmp/skill/ida-nuitka-reconstructor .claude/skills/ida-nuitka-reconstructor
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Ida Nuitka Reconstructor an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Ida Nuitka Reconstructor automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Ida Nuitka Reconstructor net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Schlësselen.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

IDA + Nuitka Source Reconstructor

Reconstruct readable Python source from Nuitka-compiled native binaries by combining IDA Pro MCP live analysis with raw PE section constant extraction.

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


When to Use This Skill

ConditionUse this skill
Nuitka onefile .exe with embedded .dll✅ Yes
Nuitka standalone .pyd / .dll✅ Yes
Nuitka + XOR/Base64 .encrypted files❌ Use nuitka-decryptor instead
PyInstaller .exe❌ Use pyinstxtractor
Electron .asar❌ Use electron-builder-unpacker

Key difference from nuitka-decryptor: This skill handles the case where Python is compiled to C (no encrypted .py files exist). The source must be reconstructed from serialized Nuitka constants, not decrypted.


How Nuitka Onefile Works

source.py → Nuitka compiler → C code → MSVC/GCC → native .dll/.exe
                                          ↓
                              Python constants serialized into PE .rsrc section
                              (strings, function names, class names, imports, URLs, HTML, JS)

Key insight: Nuitka compiles Python logic to C, but all string constants (literals, attribute names, module names, format strings) are stored as serialized blobs in the PE .rsrc section (sometimes .rdata). These constants contain enough information to reconstruct ~80-95% of the original source.


Architecture

┌─────────────────────────────────────────────────┐
│                IDA Pro (binary loaded)           │
│  ┌───────────┐  ┌──────────┐  ┌──────────────┐  │
│  │ list_funcs│  │ decompile│  │   py_eval    │  │
│  └─────┬─────┘  └────┬─────┘  └──────┬───────┘  │
│        │              │               │          │
│        └──────────┬───┘───────────────┘          │
│                   │ MCP HTTP :13337              │
└───────────────────┼──────────────────────────────┘
                    │
         ┌──────────▼──────────┐
         │ ida_mcp_analyze.py  │  ← Step 1: Structure analysis
         └──────────┬──────────┘
                    │
         ┌──────────▼──────────────┐
         │ extract_rsrc_strings.py │  ← Step 2: Raw PE .rsrc extraction
         └──────────┬──────────────┘
                    │
         ┌──────────▼────────────────────┐
         │ reconstruct_nuitka_source.py  │  ← Step 3: Source reconstruction
         └──────────┬────────────────────┘
                    │
              reconstructed/*.py

Step 1 — IDA MCP Analysis (Live Binary)

Prerequisite: IDA Pro is open with the target binary loaded. IDA MCP server running at http://127.0.0.1:13337/mcp.

Run scripts/ida_mcp_analyze.py:

bash
python scripts/ida_mcp_analyze.py --url http://127.0.0.1:13337/mcp --out ida_analysis.json

What it does:

  1. List exports — finds entry points (run_code, DllEntryPoint, etc.)
  2. List functions — catalogs all named functions with addresses
  3. Decompile key functions — pseudo-C for entry points and interesting functions
  4. PE section mapping via py_eval — finds .rsrc / .rdata offsets and sizes
  5. Check mapped memory — confirms which sections IDA has loaded

Known IDA limitations with Nuitka:

  • survey_binary timeouts on large binaries (>20MB) — script uses targeted queries instead
  • .rsrc section is NOT mapped by IDA — string searches (find, find_regex) return empty
  • IDA 9.x removed ida_search.find_binary — script uses ida_bytes.bin_search with compiled_binpat_vec_t

When IDA MCP is not available (IDA not open): Skip this step. Steps 2-3 work standalone.


Step 2 — Extract Constants from PE .rsrc Section

Run scripts/extract_rsrc_strings.py:

bash
# Basic extraction
python scripts/extract_rsrc_strings.py --binary target.dll --out extracted_strings.json

# With IDA analysis for cross-referencing
python scripts/extract_rsrc_strings.py --binary target.dll --ida-analysis ida_analysis.json --out extracted_strings.json

# Also check .rdata section
python scripts/extract_rsrc_strings.py --binary target.dll --sections rsrc,rdata --out extracted_strings.json

What it does:

  1. Parse PE headers to locate .rsrc and .rdata sections
  2. Read raw bytes from each section
  3. Extract all UTF-8 printable strings (min length 4)
  4. Categorize strings by type:
    • imports — module names (tkinter, playwright, json, etc.)
    • functions — function/method names (Nuitka prefixed with u or a)
    • classes — class names
    • urls — HTTP/HTTPS URLs and endpoints
    • html_js — embedded HTML/JavaScript code
    • format_strings — Python format strings and templates
    • constants — other string literals
  5. Detect Nuitka serialization markers (u, a, s, w prefixes)
  6. Output structured JSON for Step 3

Nuitka serialization format (see references/nuitka_serialization_format.md):

  • u prefix → unicode string literal (e.g., u\x0bhello world)
  • a prefix → attribute/identifier name (e.g., a\x04self)
  • Length encoded as 1-4 bytes after prefix
  • Strings appear in order of source code occurrence

Step 3 — Reconstruct Python Source

Run scripts/reconstruct_nuitka_source.py:

bash
# Auto-reconstruct from extracted strings
python scripts/reconstruct_nuitka_source.py \
  --strings extracted_strings.json \
  --out reconstructed/

# With IDA decompilation data for better structure
python scripts/reconstruct_nuitka_source.py \
  --strings extracted_strings.json \
  --ida-analysis ida_analysis.json \
  --out reconstructed/

# Interactive mode — shows candidates and asks for confirmation
python scripts/reconstruct_nuitka_source.py \
  --strings extracted_strings.json \
  --interactive \
  --out reconstructed/

What it does:

  1. Import recovery — identifies import X, from X import Y from module name strings
  2. Class/function skeleton — builds class and function definitions from attribute names
  3. String literal placement — maps string constants to likely code locations
  4. URL/endpoint mapping — reconstructs API call patterns
  5. GUI reconstruction — detects tkinter/Qt patterns and rebuilds UI code
  6. JavaScript/HTML embedding — preserves embedded code blocks
  7. Constants and config — reconstructs module-level constants

Reconstruction accuracy depends on:

  • Number and quality of string constants preserved by Nuitka
  • Presence of format strings (reveal variable names and logic)
  • HTML/JS templates (often contain complete code blocks)
  • Error messages (reveal function flow and validation logic)

Step 4 — Verify & Test

bash
# Syntax check
python -m py_compile reconstructed/main.py

# Try to run (may need dependencies)
pip install playwright pyotp  # or whatever the target needs
python reconstructed/main.py

# Compare behavior with original
# Run original .exe and reconstructed .py side by side

Workflow Summary

1. IDA MCP    → ida_mcp_analyze.py   → Structure: exports, functions, PE layout
2. PE EXTRACT → extract_rsrc_strings.py → All string constants from .rsrc/.rdata
3. RECONSTRUCT → reconstruct_nuitka_source.py → Python source files
4. VERIFY     → Run reconstructed code, compare with original
5. REPORT     → Present findings to user IN VIETNAMESE

Integration with Other Skills

WhenChain to
Binary not yet identifiedRun binary-identifier first
Found .encrypted files alongside .pydSwitch to nuitka-decryptor
Found anti-debug in dispatcherUse anti-debugging-techniques
Need to patch license check in reconstructed codeUse binary-patcher
Reconstructed code has obfuscated JSChain to javascript-deobfuscator
Need keygen from reconstructed license logicUse writerpro-pentest

Final Report to User (always in Vietnamese)

🔬 Tái tạo source code Nuitka hoàn tất:

  📦 Binary phân tích : <FILENAME> (<SIZE>)
  🏗️ Kiến trúc       : Nuitka Onefile (Python <VER> → C → native)
  📊 PE Sections      : .text (<SIZE>), .rsrc (<SIZE>), .rdata (<SIZE>)

  🔍 IDA MCP Analysis:
    - Exports    : <COUNT> (run_code, DllEntryPoint, ...)
    - Functions  : <COUNT> identified
    - Decompiled : <COUNT> key functions

  📝 Constants Extracted:
    - Imports       : <COUNT> module names
    - Functions     : <COUNT> function/method names
    - Classes       : <COUNT> class names
    - URLs          : <COUNT> endpoints
    - HTML/JS       : <COUNT> embedded code blocks
    - String literals: <COUNT> constants

  ✅ Source Reconstructed:
    - Files    : <COUNT> .py files
    - Lines    : <COUNT> total lines
    - Accuracy : ~<PERCENT>% (estimated)

  💾 Output: reconstructed/

  ▶ Bước tiếp theo:
    - Kiểm tra code: python reconstructed/main.py
    - Tìm secrets: grep -rn "api_key\|secret\|token" reconstructed/
    - Keygen: sử dụng writerpro-pentest nếu cần

Anti-Patterns

❌ Don't✅ Do
Search strings via IDA find/find_regex on Nuitka binaryRead raw PE bytes — .rsrc is not mapped
Use survey_binary on large Nuitka DLLsUse targeted list_funcs + decompile
Assume all Nuitka apps have .encrypted filesMany are compiled-only, no encryption layer
Try to decompile Nuitka C code back to PythonExtract constants and reconstruct — C decompilation gives Nuitka runtime, not original Python
Skip IDA when availableIDA provides function structure and xrefs that improve reconstruction accuracy
Present findings in EnglishAlways deliver final summary in Vietnamese

Matgeliwwert Dateien

De Modell liest dës Dateie bei Bedarf, wärend de Skill gelueden ass. Si ginn als liesbar Dateie bereetgestallt a ginn ni ausgeféiert.

Heefeg gestallte Froen

Wat mécht de KI-Skill Ida Nuitka Reconstructor?

Rekonstruéiert Python-Quellcode aus mat Nuitka kompiléierte Binärdateien (.dll/.exe/.pyd), andeems serialiséiert Konstanten aus PE-.rsrc/.rdata-Sektiounen extrahéiert ginn an IDA Pro MCP fir eng Live-Dekompilatioun benotzt gëtt. Benotzt dëse Skill, wann d'Zil eng Nuitka-Onefile-/Standalone-Binärdatei ouni .encrypted-Dateie ass — Python gëtt a C kompiléiert, net verschlësselt.

Firwat Ida Nuitka Reconstructor op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Ida Nuitka Reconstructor besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt, amplaz en Abonnement pro Benotzerplaz ze bezuelen. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Ida Nuitka Reconstructor an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/ptn1411/skill/tree/main/ida-nuitka-reconstructor an. TypingMind liest d'Datei SKILL.md, bëndelt déi zougehéiereg Dateien an installéiert dat Ganzt als Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Ida Nuitka Reconstructor benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Ida Nuitka Reconstructor benotzen?

Esou vill wéi Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Ida Nuitka Reconstructor domat benotzen – zum Beispill mat GPT, Claude, Gemini, Grok, DeepSeek, Mistral oder Llama – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Ida Nuitka Reconstructor gratis?

ptn1411 huet de Skill op GitHub publizéiert. Kuckt am Repository no de Lizenzbedéngungen. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbare Pak vun Instruktiounen, deen engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt e maache soll a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a kee Lafzäitëmfeld a funktionéiere mat all Modell.

Alleguer weisen

Elo Ären eegene KI-Aarbechtsberäich ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇