decompile-reconstruction
Skill0 starsChanged 6 days agoMITView on GitHub
Autonomous binary/bytecode/bundle decompilation and clean-room source code reconstruction. Triggered automatically when the user provides or asks to analyze, decompile, deobfuscate, or recover readable/compilable source code or algorithms from compiled binaries (PE/ELF/Mach-O/DLL/SO), Android APKs/JARs, .NET assemblies, Python bytecode (.pyc), WASM, or bundled/minified/obfuscated JS/Electron apps.
In this repository60 other files it gives its agents.
- AGENTS.mdAGENTS.md
- skills/agent-browser/AGENTS.mdAGENTS.md
- skills/reverse-skill/AGENTS.mdAGENTS.md
- spec-kit/AGENTS.mdAGENTS.md
- skills/reverse-skill/CLAUDE.mdCLAUDE.md
- skills/taste-skill/skills/llms.txtllms.txt
- multimodal-media-directorSkill
- novel-story-architectSkill
- screenplay-manga-directorSkill
- ui-ux-pro-maxSkill
- appsec-reviewSkill
- ask-mattSkill
- codebase-designSkill
- code-reviewSkill
- code-simplifierSkill
- diagnosing-bugsSkill
- diagram-flowchart-architectSkill
- domain-modelingSkill
- gh-pr-ci-triageSkill
- grill-with-docsSkill
- implementSkill
- implement-specSkill
- improve-codebase-architectureSkill
- prototypeSkill
- prSkill
- researchSkill
- resolving-merge-conflictsSkill
- retroSkill
- setup-matt-pocock-skillsSkill
- skill-evaluatorSkill
- tddSkill
- to-specSkill
- to-ticketsSkill
- triageSkill
- wayfinderSkill
- wizardSkill
- chrome-extensionsSkill
- modern-web-guidanceSkill
- web-data-visualizationSkill
- web-game-studioSkill
- nano-banana-proSkill
- ponytail-auditSkill
- ponytail-debtSkill
- ponytail-gainSkill
- ponytail-helpSkill
- ponytail-reviewSkill
- ponytailSkill
- grillingSkill
- grill-meSkill
- handoffSkill
- office-pro-suiteSkill
- product-requirements-grillingSkill
- role-persona-routerSkill
- teachSkill
- to-questionnaireSkill
- wait-whatSkill
- writing-for-agentsSkill
- writing-great-skillsSkill
- reverse-skills-routerSkill
- self-improving-agentSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 3 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 12
Do NOT wait for the user to specify a skill name.
- Distinctive: line 27
Never guess the target format from the file extension alone, and never run an unknown binary to see what it does.
- Distinctive: line 44
Before decompiling individual routines, build a concise evidence map of the target:
- Very specific: line 54
Zero Hallucination Rule: Every reconstructed function MUST cite its original binary address, symbol name, or bytecode offset (e.g., // …
- Very specific: line 69
Run the code-simplifier pass on the reconstructed source to remove dead decompiler temporaries and redundant casts.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Engineering Decompilation & Clean-Room Source Reconstruction (decompile-reconstruction)
This skill turns compiled binaries, bytecode packages, game/model containers, and obfuscated bundles into structured architectural maps and clean, readable, compilable source code. It synthesizes the engineering-first workflow of morluto/rea (Reverse Engineer Anything) and LaurieWired/GhidraMCP, orchestrated alongside AgentLogic's ida-reverse, ghidra-reverse, binary-ninja-reverse, go-rust-reverse, macos-reverse, apk-reverse, dotnet-reverse, js-reverse, protocol-reverse, and radare2 capabilities.
Automatic Trigger Contract (Encounter -> Auto-Use)
Do NOT wait for the user to specify a skill name. Activate this workflow automatically whenever:
- The user provides or points to a compiled or packaged artifact (
.exe,.dll,.so,.dylib,.elf,.sys,.apk,.aab,.ipa,.jar,.dex,.pyc,.wasm,.asar,.beam,.pck,.gguf,.safetensors,.ptx,.cubin,.har, or minified/obfuscated.js) and asks:- what it does, how a feature/algorithm/protocol inside it works, or
- to decompile, deobfuscate, port, or reconstruct it into clean source code.
- Scope Boundary (Engineering vs. Offensive Security):
- Engineering Reconstruction (Automatic): Analyzing program logic, recovering data structures/types, deobfuscating bundles, and reconstructing clean-room source code in the local workspace runs automatically under this route.
- Offensive Exploitation / Live Malware Execution (Restricted Manual): Never execute unknown/untrusted binaries directly on the host OS. If the task shifts to live exploitation (
pwn-chain) or active penetration testing, defer to the restricted security confirmation boundary.
The 5-Stage Clean-Room Reconstruction Pipeline
Stage 1: Non-Destructive Format Triage & Toolchain Selection
Never guess the target format from the file extension alone, and never run an unknown binary to see what it does. First inspect headers/metadata, security hardening flags (PIE, NX, RELRO, Canary, CFG, Authenticode), and runtime signatures read-only, then select the highest-fidelity available decompiler:
| Target Artifact Class | Identification Signal | Ordered Toolchain Priority (Use First Available) |
1. Native Binary (PE/ELF/Mach-O: .exe, .dll, .so, .dylib, .sys) | Native headers without CLR metadata (ELF notes, PE imports/Authenticode, Mach-O load commands) | 1. IDA Pro MCP (idapro_* via skills/reverse-skill/skills/ida-reverse/SKILL.md)<br>2. Ghidra MCP / Headless (ghidra-mcp or analyzeHeadless via skills/reverse-skill/skills/ghidra-reverse/SKILL.md)<br>3. Binary Ninja / Hopper / Kuna MCP (skills/reverse-skill/skills/binary-ninja-reverse/SKILL.md)<br>4. Radare2 + Ghidra Decompiler (r2 -qc "aaa; pdg @ <func>")<br>5. LLVM/Binutils Native Triage (llvm-objdump -d, nm -C, readelf, strings) |
| 2. Stripped Go / Rust Native Binary | .gopclntab / go.buildid or .cargo-auditable / rust_eh_personality / core::panicking | 1. go-rust-reverse Workflow (skills/reverse-skill/skills/go-rust-reverse/SKILL.md: recover pclntab symbol tables, slice/string/interface fat pointers, and Rust crate metadata)<br>2. IDA Pro / Ghidra with Go/Rust type recovery |
3. .NET / C# Managed Assembly (.exe, .dll with CLR header) | PE Data Directory[14] (CLR header) / mscoree.dll / #Strings | 1. de4dot (if obfuscated with ConfuserEx/SmartAssembly/etc.)<br>2. ilspycmd (headless C# project export: ilspycmd -p -o <out_dir> <target.dll>) or dnSpyEx / dnSpy MCP (skills/reverse-skill/skills/dotnet-reverse/SKILL.md) |
4. Android APK / Flutter / JVM Bytecode (.apk, .jar, .dex, .class) | ZIP magic + classes.dex, libapp.so (Flutter Dart AOT), or 0xCAFEBABE | 1. jadx (jadx -d <out_dir> --deobf <target.apk/jar>, see skills/reverse-skill/skills/apk-reverse/SKILL.md) or JEB MCP<br>2. blutter / reFlutter (for Flutter libapp.so Dart object pool recovery)<br>3. apktool (resources/Manifest/smali) + CFR / Vineflower (Java .jar) |
5. Game Engine & Runtime Containers (Unity IL2CPP, Godot .pck, Erlang .beam) | libil2cpp.so + global-metadata.dat, GDPC magic, or FOR1/BEAM | 1. Il2CppDumper / Cpp2IL (recover C# class/method signatures + apply to IDA/Ghidra)<br>2. gdsdecomp (GDRE Tools) (Godot .pck / .gdc bytecode recovery)<br>3. beam_disasm / erl +S (Erlang/Elixir BEAM abstract code extraction) |
6. Python Bytecode / Frozen App (.pyc, PyInstaller .exe) | Python magic header or MEI / PYZ archive | 1. pyinstxtractor / pyinstxtractor-ng (for PyInstaller containers)<br>2. pycdc (Decompyle++) or uncompyle6 (.pyc -> .py) + dis module disassembly |
7. Electron / Bundled JS / Browser Extension / WASM / EVM (.asar, .crx, .js, .wasm, .bin) | Electron app.asar, Chrome extension manifest.json, Webpack/Vite bundle, \0asm, or EVM opcodes | 1. npx @electron/asar extract (for .asar) or browser-extension-reverse<br>2. webcrack / SourceMap recovery / ast-grep structural deobfuscation (js-reverse)<br>3. wasm2wat / wasm-decompile (WABT) or Heimdall/Panoramix (EVM bytecode) |
8. AI Model, GPU Kernel & Network Protocol Captures (.gguf, .safetensors, .cubin/.ptx, .pcap/.har) | GGUF magic, JSON tensor header, cuobjdump/nvdisasm ELF, or PCAP/HAR | 1. Header & Architecture Inspector (extract GGUF/safetensors hyperparameters, tokenizer, and layer topology without loading raw weights; cuobjdump --dump-ptx / nvdisasm for GPU kernels)<br>2. protocol-reverse & derive-client (skills/reverse-skill/skills/protocol-reverse/SKILL.md: recover Protobuf/gRPC descriptors, WebSocket frames, or synthesize standalone API/RL clients from .har/.pcap) |
Missing Tool Handling: If the optimal decompiler (e.g., Ghidra, ilspycmd, jadx, pycdc, webcrack) is not installed on the host, follow Module 49's single-consent prerequisite bundle (or use the highest available native fallback with explicit disclosure of the fidelity gap).
Stage 2: Structural & Symbol Survey (Map Before Deep-Dive)
Before decompiling individual routines, build a concise evidence map of the target:
- Exports, Entrypoints & High-Fan-In Functions: Identify
main/DllMain/JNI_OnLoad, exported APIs, and functions with the highest cross-reference (xref) counts. - Strings, Constants & Import Classification: Group imports and strings by domain capability (file I/O, network/HTTP, cryptography/hashing, serialization, UI/IPC).
- Architecture & Call Graph Summary: Record the module's subsystem layout before translating any function.
Stage 3: Evidence-Backed Pseudocode & IR Extraction
Extract raw decompiler output (C pseudocode, C#, Java, Python, or WAT) for the target call chain:
- Zero Hallucination Rule: Every reconstructed function MUST cite its original binary address, symbol name, or bytecode offset (e.g.,
// Reconstructed from sub_140002A10 (0x140002A10)). Never invent functions or algorithm steps that are not backed by extracted pseudocode or disassembly. - Save raw extracted pseudocode or decompiler dumps into a dedicated working directory (e.g.,
.specify/<task>/decompiled-raw/or project scratch directory) so raw evidence remains separate from clean reconstructed code.
Stage 4: Type, Struct & Control-Flow Recovery (Clean-Room Refinement)
Raw decompiler output is full of compiler artifacts (v1, a1, *(DWORD *)(v2 + 0x18), goto LABEL_14, state-machine switches). Transform raw pseudocode into idiomatic, maintainable source code:
- Struct, Enum & Type Recovery:
- Replace raw pointer offsets (
*(uint32_t *)(ctx + 0x10)) with explicitstructfield definitions and typed pointers. - Replace magic numbers and bitwise flags with named
enumorconstdefinitions.
- Replace raw pointer offsets (
- Control-Flow Structuring (Eliminate
goto& Flattened Switches):- Convert decompiler
gotolabels and while-true break cascades back into structuredfor/whileloops, early returns, and guard clauses. - Unroll compiler-generated async/coroutine/iterator state machines back into readable
async/awaitor generator functions.
- Convert decompiler
- Semantic Renaming & Code Simplification:
- Rename
sub_xxx,v1,arg_0to domain-meaningful identifiers based on string xrefs, API calls, and data flow. - Run the
code-simplifierpass on the reconstructed source to remove dead decompiler temporaries and redundant casts.
- Rename
Stage 5: Equivalence Verification & Closure
- Compilation / Static Check: Compile or typecheck the reconstructed source code (
gcc/clang/cargo/tsc/dotnet build/javac/python -m py_compile) to prove it is valid, self-contained code rather than broken pseudocode. - Input-Output Equivalence Proof: Where known test vectors, protocol payloads, or constants exist in the binary, run a unit test or verification script proving the reconstructed function produces identical outputs to the original binary logic.
- Closure Evidence: Record
target_format_and_toolchain_triageanddecompiled_or_reconstructed_artifact.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

