Ida Nuitka Reconstructorのロゴ

Ida Nuitka Reconstructor

コミュニティ
ptn1411
ida-nuitka-reconstructor

Nuitkaでコンパイルされたバイナリ(.dll/.exe/.pyd)からシリアライズされた定数をPEの.rsrc/.rdataセクションより抽出し、IDA Pro MCPを使ったライブ逆コンパイルによってPythonソースコードを再構築します。対象がNuitkaのonefile/standaloneバイナリで、.encryptedファイルがない場合に使用します。Pythonは暗号化されているのではなく、Cにコンパイルされています。

Add to TypingMind

概要

公開者ptn1411
リポジトリskill
スキル名ida-nuitka-reconstructor
スター
275
フォーク
133
同梱ファイル
4
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 4個の同梱ファイル

    モデルが作業中に読み取れるスクリプト、テンプレート、参考資料です。ファイルは読み取り専用で、実行されることはありません。

  • オープンソース

    ptn1411がGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキル「Ida Nuitka Reconstructor」をTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/ptn1411/skill/tree/main/ida-nuitka-reconstructor
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

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
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでIda Nuitka Reconstructorを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあるとすぐに、モデルが自動的にIda Nuitka Reconstructorを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Ida Nuitka Reconstructorは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、スキルを使わない間は指示の読み込みにトークンを消費しません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

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

同梱ファイル

スキルが読み込まれている間、モデルは必要に応じてこれらを読み取ります。読み取り可能なファイルとして提供され、実行されることはありません。

よくある質問

AIスキル「Ida Nuitka Reconstructor」では何ができますか?

Nuitkaでコンパイルされたバイナリ(.dll/.exe/.pyd)からシリアライズされた定数をPEの.rsrc/.rdataセクションより抽出し、IDA Pro MCPを使ったライブ逆コンパイルによってPythonソースコードを再構築します。対象がNuitkaのonefile/standaloneバイナリで、.encryptedファイルがない場合に使用します。Pythonは暗号化されているのではなく、Cにコンパイルされています。

TypingMindでIda Nuitka Reconstructorを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Ida Nuitka Reconstructorはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにIda Nuitka Reconstructorをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/ptn1411/skill/tree/main/ida-nuitka-reconstructorを貼り付けてください。TypingMindがSKILL.mdを読み込み、関連ファイルをまとめて、チャットごとに有効にできるスキルとしてインストールします。

Ida Nuitka Reconstructorを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストの内容がこのスキルの用途に合ったときに、このスキルを読み込めます。

Ida Nuitka Reconstructorで使えるAIモデルの数に制限はありますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもIda Nuitka Reconstructorを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Ida Nuitka Reconstructor」は無料ですか?

ptn1411がGitHubで公開しています。ライセンス条件はリポジトリでご確認ください。ご利用のAIプロバイダーに支払うのは、使用したトークンの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇