Tool:reccmp
| On this wiki | Facts · Code · Notes · Topics |
|---|
Python toolkit from the LEGO Island decompilation project that compares a recompiled binary with the original function by function, using address annotations written as comments in the source.
Overview
reccmp ("recompilation compare") is a collection of decompilation tools that originated in the LEGO Island decompilation (isledecomp). Functions and data in the source are tied to the original binary by comments such as // FUNCTION: LEGO1 0x100b12c0; reccmp reads the recompiled binary and its PDB, finds each annotated function, and reports how closely its machine code matches the original. It supports 32-bit x86 C/C++ built with older Microsoft Visual C++ versions (4.x to 6.0 in the projects below). Repository: https://github.com/isledecomp/reccmp (AGPL-3.0 as reported on its GitHub page).
Project configuration
A project has a reccmp-project.yml listing targets. Each target has a filename (the original executable or DLL), a source-root, and hash: sha256: of the original file, so the SHA-256 in that file identifies the exact binary the source matches. Examples read in isledecomp/isle at 8119bd0 and in the projects listed on Technique:Matching decompilation#Known projects. Optional keys: data-sources (CSV files with strings and globals, e.g. LEGO1/reccmp-strings.csv), report: ignore-functions, ghidra: options (the project can sync names to a Ghidra database).
Annotation syntax
A comment directly above the definition: // FUNCTION: <TARGET> 0x<address> (also STUB, SYNTHETIC for compiler-generated functions, GLOBAL for variables and VTABLE for virtual tables). <TARGET> is the module name and the address is the virtual address in the original image (including the image base, e.g. 0x10001000 for LEGO1.DLL, 0x00401000-range for an EXE). Counts of annotations in isle at 8119bd0, counted with grep: LEGO1 2624 FUNCTION, 545 GLOBAL, 445 VTABLE, 213 SYNTHETIC. docs/annotations.md (reccmp commit 4708baffc6bc271ff19dbd2e53b15cb67294ba53) gives the general form // <annotation type>: <target> <address>; functions in a compilation unit must be in ascending address order (line 23). Function markers are FUNCTION, STUB (incomplete, not compared), TEMPLATE, SYNTHETIC (compiler-generated; takes precedence over TEMPLATE) and LIBRARY; the name of a template or library function is written in the comment line below the marker, either as the demangled name or as a symbol (a name starting with ? is taken as an MSVC symbol, otherwise add SYMBOL after the address). Functions merged by the linker (MSVC /OPT:ICF) take a FOLDED option after the address. Other markers: VTABLE, GLOBAL, STRING and LINE.
Commands
From the reccmp README: reccmp-project (create/detect project files), reccmp-reccmp --target <TARGET> (compare, accuracy percentages, HTML report), reccmp-decomplint (check annotations), reccmp-datacmp (global data), reccmp-vtable, reccmp-stackcmp, reccmp-aggregate. Addresses and relocations are normalised, so the rebuilt binary need not have the original layout.
Using it for a wiki symbol map
Because every annotation carries the original address, name/address pairs can be extracted with a short script (regex on the annotation line, then the first identifier before ( on the next line) and published with add_symbols: names and addresses only, with va plus the image base declared on the Build. Class methods defined inline in headers need the enclosing class added to the name.
Projects using it
See Software:LEGO Island, Software:Colin McRae Rally 2.0 and Software:LEGOLAND; also Technique:Matching decompilation.
Code & repositories
- https://github.com/isledecomp/isle @
8119bd013645972c72480e4de21529f1e91ce5c7· license: LGPL-3.0
Matching decompilation of LEGO Island (ISLE.EXE, LEGO1.DLL, CONFIG.EXE) with reccmp address annotations in the source; hashes in reccmp-project.yml.
Tested on: source read, not run: Windows x86 (Win32) retail 1.1 · checked 2026-10-18; last activity 2026-09-18; Note: the latest release ships binaries; the wiki links only the source, never the binaries - https://github.com/pablocpas/CMR2Decomp @
dadcfb1a8524c67407a677c296d2e6bbc1c1d832· license: GPL-3.0
AI-assisted matching decompilation of Colin McRae Rally 2.0 (CMR2.exe, MSVC 6.0 SP3) with // FUNCTION: CMR2 annotations; sha256 in reccmp-project.yml.
Tested on: source read, not run: Windows x86 (Win32) · checked 2026-10-18; last activity 2026-10-18 - https://github.com/isledecomp/reccmp @
435b00e6ba65f76aee2dd793fcc7d0f5139de749· license: AGPL-3.0
The reccmp decompilation comparison toolkit (annotation syntax, project config, reports).
Tested on: source read, not run: not run · checked 2026-10-18; last activity 2026-10-17