- Reverse Engineer Anything is an open-source toolkit that lets AI coding agents inspect apps, sites, JavaScript, Electron packages, and native binaries through CLI + MCP Server workflows.
- Two interfaces: use the CLI for terminal-driven analysis, or connect an MCP server so agents like Claude, Cursor, or Gemini CLI can call analysis tools directly.
- Evidence-first design: every conclusion should link to addresses, strings, traces, or artifacts — the workflow discourages AI guesswork.
- Local and safe: analysis runs on your machine; keep targets read-only and isolate unknown binaries in a VM or container.
- Start fast:
npx rea-agents@latest setupinitializes the environment and checks agent configuration.
Reverse Engineer Anything Overview & Prerequisites
Reverse Engineer Anything (REA) is an open-source reverse engineering toolkit built for AI coding agents. Instead of manually operating disassemblers and debuggers, you connect an agent through a CLI and an MCP (Model Context Protocol) server, then ask focused questions about a target — an app, a website, JavaScript bundle, Electron package, or native binary. REA emphasizes local analysis, evidence chains, and reproducible investigations rather than automatic source recovery.
The project offers two complementary interfaces:
| Interface | Audience | Best For | Key Operations |
|---|---|---|---|
| CLI | Terminal users | Scripted, repeatable analysis | analyze, inspect, search, function, xrefs, trace |
| MCP Server | AI coding agents | Tool calls inside chat sessions | Symbol search, decompilation summaries, context export |
| Setup tools | Everyone | Environment health | rea setup, rea doctor |
Before you begin, verify these prerequisites:
| Requirement | Why It Matters | Check Command |
|---|---|---|
| Node.js and npm | Runs the CLI and setup flow | node --version |
| Python 3 (optional) | Python SDK tools and scripts | python --version |
| Isolated workspace | Separates targets from reports | mkdir -p /analysis/{targets,reports} |
| Supported agent | Claude, Cursor, Codex, Gemini CLI, Windsurf, or Devin | Agent MCP settings |
Only analyze software you have the right to inspect. Keep the original target read-only, record its SHA-256 hash before and after analysis, and run unknown binaries only inside a disposable VM or container with network access disabled.
Step-by-Step: From Install to First Analysis
This is the core Reverse Engineer Anything tutorial flow. Follow the six phases in order — each one produces a deliverable the next phase depends on.
Set up the environment
Run npx rea-agents@latest setup to install the CLI and confirm the agent configuration. If anything fails, run rea doctor to diagnose missing dependencies, path errors, or Node.js and Hopper issues.
Prepare an isolated workspace
Create dedicated directories for targets and reports. Record the target's filename, size, and SHA-256 hash with sha256sum, and disable unnecessary network access before touching an unknown binary.
Connect the MCP server to your agent
Register the server in your agent's MCP configuration using stdio for local setups. Pass only the workspace directories the server needs, restart the host, and confirm the analysis tools appear in the tool list.
Profile the target
Start non-invasively: identify file type and architecture with file, list strings with strings -a -n 6, and inspect sections and imports. Build a target profile before opening a debugger.
Ask the agent focused questions
Request narrow operations — list symbols, find references to a specific string, decompile one function, trace a call path. Focused requests produce context you can actually validate.
Validate and preserve evidence
Reproduce important conclusions with the underlying tool, separate confirmed behavior from open questions, and save the report together with the target hash, tool logs, and configuration snapshot.
Whole-file analysis prompts produce bloated context and timeout failures. Ask for a single function, a section, or an address range — then chain narrow requests as your understanding grows.
Analysis Targets & Recommended Methods
Different targets need different tooling. Match the target type to the right entry point:
| Target Type | Entry Points | Focus Areas |
|---|---|---|
| Native binaries (ELF/PE/Mach-O) | Ghidra, objdump, GDB | Functions, strings, cross-references, call graphs, disassembly |
| Electron apps | ASAR extraction, package.json | Main/Renderer/Preload processes, IPC, entry files |
| JavaScript / websites | Source maps, DevTools | Bundles, runtime behavior, network calls |
| Android APKs | APK inspection tools | Manifest, resources, DEX analysis |
Static Analysis
- No execution required
- Symbols, strings, sections, imports
- First pass for every target
- Great for building a function inventory
Dynamic Analysis
- Runtime evidence
- Breakpoints, registers, memory inspection
- Validates static hypotheses
- Always run in isolation
Evidence Chain
- Reproducible conclusions
- Link findings to addresses and traces
- Export tool inputs and outputs
- Separate facts from inferences
Treat decompiled code as a starting point, not truth. Stripped or optimized binaries, obfuscation, and indirect calls all reduce recoverability — confirm uncertain functions dynamically with breakpoints or controlled inputs.
Agent Integration & Security Best Practices
REA supports six or more coding agent integrations, including Claude Code, Cursor, Codex, Gemini CLI, Windsurf, and Devin. A safe integration exposes narrow tools, passes only the context the current investigation needs, and separates read-only analysis from operations that modify files or execute programs.
Follow these permission practices:
| Practice | Implementation |
|---|---|
| Least filesystem access | Allowlist only /analysis/workspace/targets for reads, /reports for writes |
| Path validation | Resolve paths and reject traversal and symlink escapes before any tool runs |
| Approval gates | Auto-approve read-only searches; require manual approval for execution or patching |
| Bounded subprocesses | Apply timeouts and output limits to every wrapped command |
| Audit logging | Record tool name, input summary, timestamps, and exit status |
Pre-Analysis Security Checklist:
- Target hash recorded and workspace isolated
- MCP server limited to approved directories
- Network access disabled unless explicitly required
- Manual approval required before executing unknown binaries
- Secrets and personal files outside the analysis root
A properly scoped MCP server lets your agent discover tools, request focused analysis, and write reviewable reports — without ever holding unrestricted access to your system.
Troubleshooting Common Issues
Most failures fall into predictable categories. Diagnose by symptom, apply the narrowest fix, then retry with a smaller test case.
| Symptom | Likely Cause | Fix |
|---|---|---|
| MCP server exits immediately | Wrong path, missing dependency, log text corrupting stdout | Run the server command manually as the same user; redirect diagnostics to stderr |
| Tools not discovered | Registration after initialization, invalid schema, client cache | Register tools during init; validate schemas; restart the client |
| Incomplete decompilation | Stripped binary, wrong architecture assumed | Confirm format with file and readelf; load symbols; verify dynamically |
| Permission denied | Target outside allowed root, mount ownership | Move inputs into the approved workspace; grant least permission needed |
| Analysis times out | Whole-file jobs, no bounds | Add range and max-result parameters; split into bounded jobs |
| Context window overflow | Entire disassembly pasted into prompt | Pass artifact paths; use function-level queries; keep an investigation ledger |
Shell syntax, executable formats, and debugger capabilities differ between Linux, macOS, and Windows. Use cross-platform path libraries, record tool versions in every report, and pin environments in containers when reproducibility matters.
FAQ
Q: Does Reverse Engineer Anything recover original source code automatically?
No. REA is designed for evidence-based analysis and reproducible investigation of apps, websites, JavaScript, Electron packages, and native binaries. It helps agents collect and explain evidence — decompilation output is treated as a hypothesis to validate, not recovered source.
Q: Which AI coding agents work with REA?
REA connects through MCP and CLI, supporting integrations including Claude Code, Cursor, Codex, Gemini CLI, Windsurf, and Devin. Any MCP-capable host can register the server via stdio and discover its analysis tools.
Q: What should I do first when the MCP server fails to start?
Run the exact server command manually under the same operating-system user as the agent, confirm dependencies exist in the configured runtime, and make sure the server sends protocol messages only through the expected transport stream.
Q: How do I keep AI conclusions honest?
Ask for narrow, tool-backed observations, require the agent to separate observed behavior from inference, cite the code patterns or strings supporting each claim, and recheck key conclusions in the disassembler or debugger yourself.