
What REA is
REA (Reverse Engineer Anything) is a free, open-source tool that lets you or your AI agent look inside any app or file without its source code and understand how it works. It is published as the npm package rea-agents (version 6.8.0), under the MIT license.
Think of it like this: you see a feature you like in some app. You ask your AI agent (Claude Code, Cursor, Codex and others) "how does this work?" The agent uses REA to open the app, read its code, and come back with an answer plus the proof behind it.
Two ways to use it:
- MCP server for AI agents. The agent calls REA's tools automatically.
- CLI (the
reacommand) for you in a terminal. Same tools, same results.
Three things make REA different:
- Runs locally. Your target app or file never leaves your computer.
- Evidence, not guesses. Every answer comes with an Evidence record: what was found, where, and what is still unknown.
- One tool, many targets. Native binaries, JavaScript/Electron apps, .NET, Android APKs, websites, firmware, network captures and more.
[!NOTE] REA is meant for lawful use only: research, learning, compatibility work, and apps you own or are allowed to examine.
The big picture
REA is built in layers: a request enters from the CLI or MCP, flows down through shared workflows, and reaches a tool ("provider") that does the actual analysis.
flowchart TD
U["You or your AI agent"]
subgraph ENTRY["1. Entry points"]
D["rea command<br/>(scripts/rea.mjs)"]
CLI["CLI<br/>one-shot commands"]
MCP["MCP server<br/>stdio or HTTP"]
end
subgraph CORE["2. Core of REA"]
COMP["Composition<br/>builds the right tools"]
APP["Application layer<br/>shared workflows"]
SESS["Binary session<br/>one target, one provider"]
EVID["Evidence ledger<br/>facts + unknowns"]
end
subgraph PROV["3. Providers (the analysis tools)"]
NATIVE["Native engines<br/>Hopper, Ghidra, IDA, Kuna"]
JS["JavaScript / Electron<br/>reader"]
OTHER["Built-in readers<br/>.NET, Go, Rust, APK, firmware..."]
WEB["Browser / runtime<br/>Chrome, Frida, GDB"]
end
subgraph BASE["4. Foundation"]
PROC["Process manager<br/>safe start/stop, timeouts"]
DOM["Domain<br/>pure rules + data models"]
end
U --> D
D --> CLI
D --> MCP
CLI --> COMP
MCP --> COMP
CLI --> APP
MCP --> APP
COMP --> SESS
APP --> SESS
SESS --> EVID
COMP --> NATIVE
APP --> JS
COMP --> OTHER
APP --> WEB
NATIVE --> PROC
WEB --> PROC
OTHER --> DOM
JS --> DOM
EVID --> DOM
PROC --> DOMHow to read it, top to bottom:
- Entry points — you type
rea ...or your agent calls an MCP tool. Both land in the same dispatcher. - Core — REA picks the right tool for your target, opens a session, and records every finding as Evidence.
- Providers — the real workers. Some are outside programs (Ghidra, Hopper), some are readers built into REA.
- Foundation — runs outside programs safely and holds the pure data rules everything else shares.
The project's own detailed map is in docs/architecture.mermaid in the repo.
How it works, step by step
Every investigation follows the same 4-step loop: Ask → Inspect & trace → Read the evidence → Use what you learn. If the answer is incomplete, the agent asks a follow-up and the loop runs again.
flowchart LR
A["1. Ask<br/>Agent + local target<br/>(app, binary, website)"] --> B["2. Inspect & trace<br/>REA runs analysis tools"]
B --> C["3. Read the evidence<br/>code, references, unknowns"]
C --> D["4. Use what you learn<br/>explain, implement, test"]
C -- "follow-up question" --> AWhat happens inside one request
Here is the detail of a native-binary question, for example "how does search work in this app?":
sequenceDiagram
actor User
participant Agent as AI agent
participant REA as REA MCP server
participant Reg as Provider registry
participant Eng as Engine (e.g. Ghidra)
participant Ev as Evidence ledger
User->>Agent: How does search work in this app?
Agent->>REA: open_binary(path)
REA->>Reg: Which provider supports this file?
Reg-->>REA: Ghidra (or the one you chose)
REA->>Eng: Start engine, load the binary
Agent->>REA: list functions / find strings
REA->>Eng: Query
Eng-->>REA: Raw result
REA->>Ev: Save as Evidence (facts + unknowns)
REA-->>Agent: Result + evidence_id
Agent->>REA: analyze_function(search)
REA->>Eng: Decompile, find callers
Eng-->>REA: Pseudocode, assembly, references
REA->>Ev: Save Evidence
REA-->>Agent: Result + evidence_id
Agent->>REA: close_binary (optional: save snapshot)
Agent-->>User: Explanation + proof + new codeThe same steps in plain words
- Open the target. The agent calls
open_binarywith a file path. - Pick a provider. REA checks which engines support this file. If only one fits, it uses that one. If several fit, you choose (for example
--provider ghidra). There is no silent fallback. - Lock the session. That provider stays bound to the target until you close or switch.
- Ask questions. List functions, search strings, decompile a function, trace who calls whom.
- Record Evidence. Every answer is saved with an
evidence_id, the raw tool output, and a list of unknowns (things REA could not confirm). - Close and save.
close_binarycan save a snapshot, so the same question later is answered instantly from cache.
For JavaScript/Electron apps and .NET files the flow is simpler: REA reads the files directly, with no outside engine and without running the app.
Key parts of the code
The code is TypeScript (Node.js), with small bridge scripts in Python, Java and Swift that run inside outside tools.
| Folder | What it does, simply |
|---|---|
scripts/rea.mjs |
The rea command. Decides: run MCP server or a one-shot CLI command |
src/cli/, src/cli.ts |
Terminal commands like rea analyze and rea setup |
src/main/, src/main.ts |
Starts the MCP server for AI agents |
src/server/ |
Turns MCP tool calls into REA work and registers all tools |
src/composition/ |
Builds fresh providers and sessions for each job |
src/application/ |
Shared workflows used by both CLI and MCP |
src/domain/ |
Pure rules and data models, no side effects |
src/contracts/ |
Input/output schemas every tool must follow |
src/ghidra/, src/hopper/, src/ida/, src/kuna/ |
Connectors to native decompilers |
bridge/ |
Scripts that run inside Hopper, Ghidra, Cutter |
src/browser/, src/inspector/ |
Watch websites and running JavaScript |
src/process/, src/filesystem/ |
Start outside programs safely, with time limits and cleanup |
src/config/ |
Reads settings from environment variables |
tests/ |
Vitest test suite with fake engines |
What REA can analyze
mindmap
root((REA))
Native
Binaries via Hopper, Ghidra, IDA, Kuna
Go and Rust metadata
ELF, PE, kernel modules
GPU code, WASM, EVM
Apps
JavaScript and Electron
.NET assemblies
Python PyInstaller
Unity IL2CPP, Godot PCK
Mobile
Android APK via JADX
APK signatures
ADB devices
Flutter
Web and runtime
Websites via Chrome
HAR network captures
Process behavior
Frida, GDB
Data and hardware
Firmware via Binwalk
Packet captures
SQLite databases
AI model filesMany targets need nothing extra (built-in readers). Others need a tool you install yourself, such as Ghidra for native code or JADX for Android.
Getting started
You need Node.js 22.x (22.23.4 or newer), 24.x (24.22.1 or newer) or 26.12.1+, plus npm. On Linux, a procps-compatible ps must be on your PATH.
flowchart TD
S["Start"] --> Q{"How will you use REA?"}
Q -- "With an AI agent" --> A1["npx rea-agents setup"]
A1 --> A2["Pick agents, approve changes"]
A2 --> A3["Restart your agent"]
A3 --> A4["Ask: how does feature X work?"]
Q -- "In the terminal" --> T1["npm install --global rea-agents"]
T1 --> T2{"Native binary?"}
T2 -- "Yes" --> T3["Install Ghidra / Hopper / IDA / Kuna"]
T3 --> T4["rea analyze file --provider ghidra"]
T2 -- "No (JS, .NET, Go...)" --> T5["Run the matching rea command"]Option 1: With your AI agent
npx rea-agents setupChoose your agents, review the changes, approve, and restart the agent. Setup backs up your existing config. Then just ask in plain words:
Understand how search works in the Notes app, show me the evidence,
and build a similar feature for my project.Option 2: In the terminal
npm install --global rea-agents
rea --helpUseful commands:
# JavaScript / Electron app (no engine needed)
rea analyze-javascript-application /path/to/app --json
# Go binary build info (no Go needed)
rea inspect-go-binary /path/to/program --json
# See which providers are available
rea providers --json
# Native binary with a chosen engine + saved snapshot
rea analyze /path/to/program --provider ghidra --snapshot /path/to/program.json
# Keep REA updated
rea update[!TIP] Tip: Big apps can produce huge Evidence files (one Obsidian scan was 334 MB). Save it to a file and ask for a summary view with
rea inspect-analysis-view, which shrinks it to about 10 KB.
Glossary and FAQ
| Word | Meaning |
|---|---|
| Reverse engineering | Working out how software works by studying the finished app, not its source code |
| MCP | Model Context Protocol: a standard way for AI agents to call outside tools |
| CLI | Command-line interface: the rea command in your terminal |
| Binary | A compiled program file (.exe, .dll, Mach-O, ELF) |
| Provider | The engine that does the analysis (Ghidra, Hopper, IDA, Kuna, or a built-in reader) |
| Session | One open target bound to one provider until you close it |
| Evidence | The saved record of a result: facts, raw output, and source location |
| Unknown | Something REA could not confirm; reported honestly instead of guessed |
| Snapshot | A saved cache of results, reused when the same question is asked again |
| Decompile | Turn machine code back into readable pseudocode |
Which agents work with REA?
Any agent that supports local MCP servers. Setup configures Claude Code, Codex, Cursor, Gemini CLI, Grok Build and others automatically.
Do I need Ghidra or Hopper?
Only for deep native-binary analysis. JavaScript, .NET and many file formats work without them.
Does REA upload my app?
No. Analysis runs on your machine. Your agent's model provider still sees the tool results.
What code does REA give back?
Pseudocode and assembly for native apps; modules and their links for JavaScript apps. Your agent then writes and tests the new code.
Hit a bug?
Run rea update (or npx rea-agents@latest setup), restart your agent and retry. Still broken? Open a GitHub issue with your version, target type and error.
Sources
- morluto/rea on GitHub — README,
docs/architecture.mermaid,docs/cli.md,docs/mcp-contracts.md - rea.tools website