Reverse Engineer Anything Tutorial: Step-by-Step Setup - ゲーム

Reverse Engineer Anything Tutorial: Step-by-Step Setup

Learn the full Reverse Engineer Anything workflow: CLI setup, MCP server configuration, agent integration, binary analysis, and evidence-based reporting.

2026-10-18
reverse engineer anything Wiki Team
Quick Guide
  • 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 setup initializes 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:

InterfaceAudienceBest ForKey Operations
CLITerminal usersScripted, repeatable analysisanalyze, inspect, search, function, xrefs, trace
MCP ServerAI coding agentsTool calls inside chat sessionsSymbol search, decompilation summaries, context export
Setup toolsEveryoneEnvironment healthrea setup, rea doctor

Before you begin, verify these prerequisites:

RequirementWhy It MattersCheck Command
Node.js and npmRuns the CLI and setup flownode --version
Python 3 (optional)Python SDK tools and scriptspython --version
Isolated workspaceSeparates targets from reportsmkdir -p /analysis/{targets,reports}
Supported agentClaude, Cursor, Codex, Gemini CLI, Windsurf, or DevinAgent MCP settings
Before You Analyze Anything

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.

1

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.

2

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.

3

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.

4

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.

5

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.

6

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.

Pro Tip: Narrow Beats Broad

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 TypeEntry PointsFocus Areas
Native binaries (ELF/PE/Mach-O)Ghidra, objdump, GDBFunctions, strings, cross-references, call graphs, disassembly
Electron appsASAR extraction, package.jsonMain/Renderer/Preload processes, IPC, entry files
JavaScript / websitesSource maps, DevToolsBundles, runtime behavior, network calls
Android APKsAPK inspection toolsManifest, 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
Decompiler Output Is a Hypothesis

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:

PracticeImplementation
Least filesystem accessAllowlist only /analysis/workspace/targets for reads, /reports for writes
Path validationResolve paths and reject traversal and symlink escapes before any tool runs
Approval gatesAuto-approve read-only searches; require manual approval for execution or patching
Bounded subprocessesApply timeouts and output limits to every wrapped command
Audit loggingRecord 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
Well-Configured Setup

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.

SymptomLikely CauseFix
MCP server exits immediatelyWrong path, missing dependency, log text corrupting stdoutRun the server command manually as the same user; redirect diagnostics to stderr
Tools not discoveredRegistration after initialization, invalid schema, client cacheRegister tools during init; validate schemas; restart the client
Incomplete decompilationStripped binary, wrong architecture assumedConfirm format with file and readelf; load symbols; verify dynamically
Permission deniedTarget outside allowed root, mount ownershipMove inputs into the approved workspace; grant least permission needed
Analysis times outWhole-file jobs, no boundsAdd range and max-result parameters; split into bounded jobs
Context window overflowEntire disassembly pasted into promptPass artifact paths; use function-level queries; keep an investigation ledger
Cross-Platform Gotcha

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.

Related Articles