Find your next open-source project

Search by name, purpose, or keyword, or paste a GitHub URL. Start with / to search agent skills (e.g. /pdf)

DimitriFourny/fast-decomp

Security & PrivacyReverse engineering

A fast static decompiler that converts x86-64 PE and ELF functions into C-like pseudocode for analysis and AI agents.

482
42
Rust
MIT
5 days old
+45 stars in 24h

What it does

fast-decomp takes x86-64 machine code from PE or ELF binaries and rewrites each function as C-like pseudocode. It targets whole programs, not single routines: the project reports decompiling Godot's 137,813 functions in about 23 seconds on 6 cores. Names, types, prototypes, and comments belong to a project directory beside the binary, so a person or an AI agent can read, search, and annotate results across sessions.

Guesses are marked rather than silently folded into the output. Facts are either proven from the machine code under the project's stated premises, marked likely as heuristics, or asserted by the user's project. Unhandled instructions appear as explicit unknowns such as __unknown("unlifted fld", ...) instead of being dropped.

Quick start

Requirements are Rust 1.100 (selected by rust-toolchain.toml) and a C compiler for the demo; testing is reported on Linux x86-64. Clone the repository, build, and put the binary on PATH:

cargo build --release
export PATH=$PWD/target/release:$PATH
cc -O2 -o demo crates/fd-cli/tests/project_fixture.c

List the demo's functions, decompile one, and export the whole binary:

fast-decomp functions demo --name list
fast-decomp decompile demo --function list_sum
fast-decomp export demo --out demo-decomp

To keep annotations, initialise a project, declare a C type, then rename and retype a function at the address printed by functions:

fast-decomp project init demo
fast-decomp annotate demo types --decl "struct node { int32_t key; int32_t flags; struct node *next; };"
fast-decomp annotate demo func 0x12c0 --name sum_keys --sig "int32_t sum_keys(struct node *list)"
fast-decomp decompile demo --function sum_keys

The address in the example is the one the README's build produces; use the address your own binary reports. Getting started documents each step, and working with an agent covers a full session, MCP configuration, and an analysis loop.

Output and annotation model

Declarations change names and types, not what the printed code is claimed to compute. In the README's SQLite example, declaring struct sqlite3_str and renaming sub_36fd0 to sqlite3_str_append improves readability while leaving the 64-bit width of an argument unchanged because the machine code uses all of rdx. For C++, classes, this, and virtual calls are recovered from RTTI and vtables, while function names can come from the program's own error strings.

Speed and validation

Benchmarks on 6 cores report SQLite at 0.37 s, OpenTTD at 3.9 s, node at 14.8 s, and the Godot editor at 22.6 s for decompiling all functions. The comparison against Ghidra 12.2 headless is on the same stripped binaries: SQLite 0.41 s versus 94 s, OpenTTD 6.4 s versus 27 minutes, and Godot 28 s versus no text after 6.5 hours (method and caveats). The author also cites independent model reviews that preferred fast-decomp's text on 47 of 60 C++ functions from three MSVC games, while finding wrong statements in 6 of its texts versus 39 of Ghidra's (review details). These are project-reported measurements, not an independent HotRepo evaluation.

Limits

  • Only x86-64 input is supported; x87, MMX, and AVX-512 instructions appear as explicit unknown effects.
  • Output is pseudocode, not source that can be recompiled.
  • C++ exception handlers remain separate functions rather than try/catch blocks in their parents.
  • The class behind a virtual call is known for roughly a quarter of call sites in a large engine; classes without virtual methods are grouped only by shared structure.
  • Library functions are named only for runtime builds with signatures (four MSVC toolset versions); fast-decomp libsig build can generate more from a program with a PDB.
  • Heavily optimised code keeps goto statements, and heuristic facts marked likely can be wrong. On MSVC-built C++, reviewers still found wrong statements in about one text in ten, mostly about call arguments.
  • The previous TypeScript project, open-decomp, retains AArch64 Mach-O, a Python-like dialect, and Objective-C and Swift metadata that fast-decomp does not yet cover.

The code is MIT licensed; dependencies and library data derived from system headers and runtimes keep their own terms, listed in the third-party notices.

HotRepo's take

HotRepo first recorded the repository on 2026-11-30, in the new-project list, with 26 stars gained over a one-hour window and no all-language daily rank. The project is explicitly experimental yet provides an unusually detailed validity section, a self-check over 862,105 functions in 29 corpus binaries, and a documented comparison with Ghidra. In this snapshot the reader must weigh the reported speed and review results against the stated accuracy caveats on MSVC-built C++, where roughly one text in ten still contained wrong statements in the project's own review.

Written by AI from the project's public information and HotRepo's records, updated . The project's own docs are the source of truth.

You might also like

  1. MG1937/ASCOn-demand Android APK decompiler for mobile reverse engineers and AI agents, with millisecond class extraction and cross-DEX reference search.Python2,722
  2. LaurieWired/GhidraMCPLets an LLM drive Ghidra's decompiler and symbol renaming so reverse engineering of unfamiliar binaries can be automated.Java11,509
  3. skylot/jadxTurns Android APKs and Dalvik bytecode back into readable Java for reverse engineers and security analysts.Java51,238
  4. momusdigital/fnv_decompByte-exact C++ decompilation of Fallout: New Vegas 1.4.0.525, intended for modding research and game preservation.C++113
  5. x86rc/unthemidatorStatically unpacks Themida, Code Virtualizer and WinLicense-protected Windows binaries and rebuilds a runnable PE.C++150