Skip to content

Reko - Open-Source Binary Decompiler Cheatsheet

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

MethodHow
ReleaseDownload from GitHub Releases (Windows/Linux/macOS)
GUIRun reko (WPF/Avalonia UI)
CLIdecompile / reko-cli binary
From sourceBuild the .NET solution
Verifyreko-cli --version

Command-Line Decompilation

CommandDescription
reko-cli binary.exeDecompile with format auto-detection
reko-cli --arch x86-protected-32 raw.binForce an architecture
reko-cli --base 0x8000 raw.binSet the load address
reko-cli --loader raw ...Treat input as a raw image
reko-cli -o outdir binaryOutput directory
# Decompile a raw Z80 ROM loaded at 0x0000
reko-cli --loader raw --arch z80 --base 0x0000 game.rom

Output Artifacts

FileContains
*.cDecompiled C source
*.hRecovered type/struct declarations
*.disDisassembly listing
*.rekoProject file (reload in the GUI)
Call graphProgram structure

Supported Architectures (selection)

ModernLegacy / embedded
x86 / x86-646502 / 65C02
ARM / AArch64Z80 / 8080
MIPS68000 (m68k)
PowerPCVAX, PDP-11
SPARC8051, AVR
RISC-VCray, 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

PhaseDoes
LoadingParse the container (PE/ELF/raw/etc.)
ScanningDiscover code vs data, find procedures
RewritingLift instructions to an intermediate representation
AnalysisData flow, type inference, structure recovery
StructuringRebuild loops and conditionals
OutputEmit 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

TaskHow
Open a binaryFile → Open, choose loader/arch if prompted
Browse proceduresProcedure list pane
View decompiled CCode pane per procedure
Rename/retypeEdit symbols to improve output
Re-run analysisReanalyze 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

ProblemFix
Code seen as dataMark entry points / procedure starts
Wrong load addressSet --base correctly
Garbled outputConfirm architecture and endianness
Unnamed everythingRename procedures/variables as you learn them
Missing signaturesProvide type/signature metadata files

Reko vs Other Decompilers

AspectRekoGhidraRetDec
Legacy architecturesExceptionalGoodModerate
Interactive GUIYesYes (richer)No
Scriptable batchYes (CLI)YesYes
LanguageC#JavaC++
Best forRetro/exotic targetsGeneral interactive REBatch, embedded pipelines

Use Ghidra for mainstream interactive RE and RetDec for batch pipelines; Reko earns its place when the architecture is unusual.

Resources