Reko - Open-Source Binary Decompiler Cheatsheet
Reko is an open-source binary decompiler written in C# that converts machine code into readable C-like source. Its standout characteristic is architecture breadth, especially for legacy and exotic platforms: alongside x86, x64, and ARM it handles 6502, Z80, 68000, VAX, PDP-11, SPARC, PowerPC, and many more. That makes it the practical choice for retrocomputing, vintage firmware, and embedded targets where mainstream tools have no support at all. It offers both a GUI and a command-line decompiler.
Installation
| Method | How |
|---|
| Release | Download from GitHub Releases (Windows/Linux/macOS) |
| GUI | Run reko (WPF/Avalonia UI) |
| CLI | decompile / reko-cli binary |
| From source | Build the .NET solution |
| Verify | reko-cli --version |
Command-Line Decompilation
| Command | Description |
|---|
reko-cli binary.exe | Decompile with format auto-detection |
reko-cli --arch x86-protected-32 raw.bin | Force an architecture |
reko-cli --base 0x8000 raw.bin | Set the load address |
reko-cli --loader raw ... | Treat input as a raw image |
reko-cli -o outdir binary | Output directory |
# Decompile a raw Z80 ROM loaded at 0x0000
reko-cli --loader raw --arch z80 --base 0x0000 game.rom
Output Artifacts
| File | Contains |
|---|
*.c | Decompiled C source |
*.h | Recovered type/struct declarations |
*.dis | Disassembly listing |
*.reko | Project file (reload in the GUI) |
| Call graph | Program structure |
Supported Architectures (selection)
| Modern | Legacy / embedded |
|---|
| x86 / x86-64 | 6502 / 65C02 |
| ARM / AArch64 | Z80 / 8080 |
| MIPS | 68000 (m68k) |
| PowerPC | VAX, PDP-11 |
| SPARC | 8051, AVR |
| RISC-V | Cray, Alpha, and more |
This is the reason to reach for Reko: when the binary is from a 1980s console, an industrial controller, or a mainframe, other decompilers simply do not load it.
The Decompilation Pipeline
| Phase | Does |
|---|
| Loading | Parse the container (PE/ELF/raw/etc.) |
| Scanning | Discover code vs data, find procedures |
| Rewriting | Lift instructions to an intermediate representation |
| Analysis | Data flow, type inference, structure recovery |
| Structuring | Rebuild loops and conditionals |
| Output | Emit C and headers |
Understanding the phases helps when output is poor — usually the fix is guiding the scanning phase with correct entry points and load addresses.
Working in the GUI
| Task | How |
|---|
| Open a binary | File → Open, choose loader/arch if prompted |
| Browse procedures | Procedure list pane |
| View decompiled C | Code pane per procedure |
| Rename/retype | Edit symbols to improve output |
| Re-run analysis | Reanalyze after annotations |
| Save project | .reko file preserves your annotations |
Iterating — annotate, re-analyze, read again — is how you get genuinely readable output from a stripped binary.
Improving Output Quality
| Problem | Fix |
|---|
| Code seen as data | Mark entry points / procedure starts |
| Wrong load address | Set --base correctly |
| Garbled output | Confirm architecture and endianness |
| Unnamed everything | Rename procedures/variables as you learn them |
| Missing signatures | Provide type/signature metadata files |
Reko vs Other Decompilers
| Aspect | Reko | Ghidra | RetDec |
|---|
| Legacy architectures | Exceptional | Good | Moderate |
| Interactive GUI | Yes | Yes (richer) | No |
| Scriptable batch | Yes (CLI) | Yes | Yes |
| Language | C# | Java | C++ |
| Best for | Retro/exotic targets | General interactive RE | Batch, embedded pipelines |
Use Ghidra for mainstream interactive RE and RetDec for batch pipelines; Reko earns its place when the architecture is unusual.
Resources