hammerill/universal-decompiler
Decompile a binary you own into a compilable C++/CMake PC reconstruction with an AI agent: recon (format, compiler, engine, protections), tool checks, Ghidra via pyghidra-mcp, a function tracker, builds, verification against the original, asset-extraction scripts, a publish guard, and a shared knowledge base of how binaries were decompiled.
Write tools/extract_assets.py - the single-file uv run script with inline PEP 723 dependencies that reads the user's own copy of the software and writes exactly what the rebuilt program needs into data/ - and reverse-engineer the archive and asset formats it needs (pak/wad/bigfile/disc filesystems, compression, textures, audio), proving them with a round trip. Use when the reconstruction needs the original's assets, when an archive format must be decoded, or when the user asks how to get their game data into the rebuilt program.
Work out what a binary is before decompiling it - prior art, container format, architecture and bitness, compiler and toolchain (MSVC version from the Rich header, GCC/Clang, Metrowerks, SN Systems), debug info (PDB path, DWARF, symbols), linked middleware (RenderWare, Bink, FMOD, Wwise, Havok, PhysX, Scaleform, Lua), engine, packers/DRM/anti-cheat - and choose the route. Use at the start of any decompilation or when the user asks "what is this exe/ROM", "what engine/compiler built this", "can this be decompiled", "is it protected". Produces DECOMP_PLAN.md.
Turn decompiler output into buildable, behaviour-faithful C++17 with CMake that compiles with MSVC on Windows, GCC/Clang on Linux and Apple Clang on macOS as 64-bit - project layout, original-address comments, structs from offsets, the platform layer (SDL3) replacing Win32/DirectX/console SDKs, replacing proprietary middleware with open equivalents (librw-style), the re3-style DLL-injection hybrid, 32-to-64-bit porting pitfalls, and the macOS/arm64 fixes (Clang strictness, missing glibc headers, x86 intrinsics). Use when writing or fixing the reconstruction's code, setting up its CMake build, or porting it off the original platform.
Decompile a binary the user owns (PC or console game, or other software) into a compilable PC reconstruction of its core program, re3-style - readable C++17 that builds with CMake on Windows, Linux and macOS and runs with assets extracted from the user's own copy. Covers intake and the done criterion, prior art, recon (format, compiler, engine, protections), tool checks, route choice (DLL-injection hybrid, clean-room rewrite, static recompilation, managed decompilation, engine project recovery), Ghidra via pyghidra-mcp, the function tracker, C++/CMake porting, the platform layer, asset extraction scripts, verification against the original, and field notes. Use when the user wants to decompile, reverse engineer, port, reimplement, recompile or "re3" an executable, ROM, game or engine ("decompile this exe", "make a PC port of my N64 game", "rebuild the engine from the binary", "get source code back from this game").
Read how a binary actually works so it can be reconstructed - Ghidra driven through pyghidra-mcp (decompile, rename, retype, structs, vtables, RTTI, cross-references), headless Ghidra exports, managed decompilers (ilspycmd, Cpp2IL, Vineflower, PyLingual), and proving a file format with a round trip. Use when a decompilation needs function-level understanding ("what does this function do", "rebuild this struct", "name these functions", "what format is this archive"), or to set up Ghidra/pyghidra-mcp for an agent.
Search and contribute to the shared knowledge base of how binaries were actually decompiled - field notes with exact versions, the route and why, what the program or engine really does, how it was verified, and gotchas. Use before starting a decompilation ("has anyone decompiled X?", "how does engine Y store Z?"), when stuck on a tool or engine quirk, and at the end of a decompilation session to write up what was learned and, with the human's OK, open a pull request so the next agent benefits.
Build, launch and verify a reconstruction against the original binary, which is the oracle - ud build error summaries, ud run (capture stdout/stderr and log files, window screenshots on Windows, Linux and macOS, kill by exact PID at a timeout), side-by-side runs and ud run --compare for deterministic output, repeatable scenarios (seeds, scripted input, traces), and the 3-strike circuit breaker. Use whenever the reconstruction must be built, run, tested, compared with the original, or when something fails repeatedly.