# anusreesunilkumar/rea architecture

> Architecture diagram of the GitHub repository anusreesunilkumar/rea, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-22). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/anusreesunilkumar/rea
- Repository: https://github.com/anusreesunilkumar/rea

## Overview

REA is a local reverse-engineering toolkit exposed through MCP and a CLI. An agent or terminal user selects a target; REA runs analysis through specialized providers and returns findings with evidence and limitations. The graph preserves the documented native, JavaScript/Electron, Android, and website-analysis capabilities. Some capability internals are unsampled, so only documented or indexed relationships are shown; provider-specific connections are omitted where wiring is not evidenced.

Main entry points: [`src/application/reverse/ReverseEngineeringService.ts`](https://github.com/anusreesunilkumar/rea/blob/main/src/application/reverse/ReverseEngineeringService.ts) (Reverse Analysis), [`src/process/ProviderProcess.ts`](https://github.com/anusreesunilkumar/rea/blob/main/src/process/ProviderProcess.ts) (Provider Processes), [`src/main.ts`](https://github.com/anusreesunilkumar/rea/blob/main/src/main.ts) (MCP Runtime), [`src/cli.ts`](https://github.com/anusreesunilkumar/rea/blob/main/src/cli.ts) (CLI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["User Interfaces"]
  node_mcp["MCP Runtime<br/>[main.ts]"]
  node_cli["CLI<br/>[cli.ts]"]
  node_tool_routes["Reverse Tools"]
  node_cli_routes["Reverse Commands"]
end

subgraph group_workflow["Analysis Workflows"]
  node_reverse_service["Reverse Analysis"]
  node_javascript["JavaScript Analysis"]
  node_android["Android Analysis<br/>[JadxSession.ts]"]
  node_browser["Browser Observation"]
  node_scenario["Browser Scenarios"]
end

subgraph group_providers["Analysis Providers"]
  node_ghidra["Ghidra Provider<br/>[GhidraClient.ts]"]
  node_hopper["Hopper Provider<br/>[HopperClient.ts]"]
  node_ida["IDA Provider"]
  node_gdb["GDB Sessions"]
  node_rizin["Rizin Sessions"]
  node_cutter["Cutter Bridge"]
end

subgraph group_evidence["Results and Runtime"]
  node_evidence["Evidence Records<br/>[evidence.ts]"]
  node_browser_storage[("Capture Storage")]
  node_scenario_storage[("Scenario Storage")]
  node_errors["Error Projection"]
  node_process["Provider Processes<br/>[ProviderProcess.ts]"]
end

node_agent(("Agent"))
node_terminal(("Terminal User"))

node_agent -->|"requests analysis"| node_mcp
node_terminal -->|"runs commands"| node_cli
node_mcp -.->|"registers tools"| node_tool_routes
node_cli -.->|"dispatches commands"| node_cli_routes
node_tool_routes -->|"calls service"| node_reverse_service
node_cli_routes -->|"calls service"| node_reverse_service
node_reverse_service -->|"creates findings"| node_evidence
node_reverse_service -->|"runs providers"| node_process
node_ghidra -->|"manages process"| node_process
node_hopper -->|"manages process"| node_process
node_gdb -->|"manages process"| node_process
node_rizin -->|"manages process"| node_process
node_browser -.->|"stores captures"| node_browser_storage
node_scenario -.->|"stores scenarios"| node_scenario_storage
node_reverse_service -.->|"returns failures"| node_errors

click node_mcp "https://github.com/anusreesunilkumar/rea/blob/main/src/main.ts"
click node_cli "https://github.com/anusreesunilkumar/rea/blob/main/src/cli.ts"
click node_tool_routes "https://github.com/anusreesunilkumar/rea/blob/main/src/server/registerReverseEngineeringTools.ts"
click node_cli_routes "https://github.com/anusreesunilkumar/rea/blob/main/src/cli/reverseEngineeringCommands.ts"
click node_reverse_service "https://github.com/anusreesunilkumar/rea/blob/main/src/application/reverse/ReverseEngineeringService.ts"
click node_javascript "https://github.com/anusreesunilkumar/rea/blob/main/src/javascript/analysis/JavaScriptAnalysisWorker.ts"
click node_android "https://github.com/anusreesunilkumar/rea/blob/main/src/android/JadxSession.ts"
click node_browser "https://github.com/anusreesunilkumar/rea/blob/main/src/application/BrowserObservationService.ts"
click node_scenario "https://github.com/anusreesunilkumar/rea/blob/main/src/application/BrowserScenarioCaptureService.ts"
click node_ghidra "https://github.com/anusreesunilkumar/rea/blob/main/src/ghidra/GhidraClient.ts"
click node_hopper "https://github.com/anusreesunilkumar/rea/blob/main/src/hopper/HopperClient.ts"
click node_ida "https://github.com/anusreesunilkumar/rea/blob/main/src/ida/IdaSessionClient.ts"
click node_gdb "https://github.com/anusreesunilkumar/rea/blob/main/src/gdb/GdbSessionManager.ts"
click node_rizin "https://github.com/anusreesunilkumar/rea/blob/main/src/rizin/RizinDebugSessionManager.ts"
click node_cutter "https://github.com/anusreesunilkumar/rea/blob/main/src/cutter/CutterBridgeClient.ts"
click node_evidence "https://github.com/anusreesunilkumar/rea/blob/main/src/domain/evidence.ts"
click node_browser_storage "https://github.com/anusreesunilkumar/rea/blob/main/src/browser/CdpCaptureStorage.ts"
click node_scenario_storage "https://github.com/anusreesunilkumar/rea/blob/main/src/browser/PlaywrightScenarioStorage.ts"
click node_errors "https://github.com/anusreesunilkumar/rea/blob/main/src/domain/analysisErrorProjection.ts"
click node_process "https://github.com/anusreesunilkumar/rea/blob/main/src/process/ProviderProcess.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_mcp,node_cli,node_tool_routes,node_cli_routes,node_terminal toneBlue
class node_reverse_service,node_javascript,node_android,node_browser,node_scenario toneAmber
class node_ghidra,node_hopper,node_ida,node_gdb,node_rizin,node_cutter toneMint
class node_evidence,node_browser_storage,node_scenario_storage,node_errors,node_process toneRose
class node_agent toneIndigo
```

## Components

### User Interfaces

- [MCP Runtime](https://github.com/anusreesunilkumar/rea/blob/main/src/main.ts): `src/main.ts`
- [CLI](https://github.com/anusreesunilkumar/rea/blob/main/src/cli.ts): `src/cli.ts`
- [Reverse Tools](https://github.com/anusreesunilkumar/rea/blob/main/src/server/registerReverseEngineeringTools.ts): `src/server/registerReverseEngineeringTools.ts`
- [Reverse Commands](https://github.com/anusreesunilkumar/rea/blob/main/src/cli/reverseEngineeringCommands.ts): `src/cli/reverseEngineeringCommands.ts`

### Analysis Workflows

- [Reverse Analysis](https://github.com/anusreesunilkumar/rea/blob/main/src/application/reverse/ReverseEngineeringService.ts): `src/application/reverse/ReverseEngineeringService.ts`
- [JavaScript Analysis](https://github.com/anusreesunilkumar/rea/blob/main/src/javascript/analysis/JavaScriptAnalysisWorker.ts): `src/javascript/analysis/JavaScriptAnalysisWorker.ts`
- [Android Analysis](https://github.com/anusreesunilkumar/rea/blob/main/src/android/JadxSession.ts): `src/android/JadxSession.ts`
- [Browser Observation](https://github.com/anusreesunilkumar/rea/blob/main/src/application/BrowserObservationService.ts): `src/application/BrowserObservationService.ts`
- [Browser Scenarios](https://github.com/anusreesunilkumar/rea/blob/main/src/application/BrowserScenarioCaptureService.ts): `src/application/BrowserScenarioCaptureService.ts`

### Analysis Providers

- [Ghidra Provider](https://github.com/anusreesunilkumar/rea/blob/main/src/ghidra/GhidraClient.ts): `src/ghidra/GhidraClient.ts`
- [Hopper Provider](https://github.com/anusreesunilkumar/rea/blob/main/src/hopper/HopperClient.ts): `src/hopper/HopperClient.ts`
- [IDA Provider](https://github.com/anusreesunilkumar/rea/blob/main/src/ida/IdaSessionClient.ts): `src/ida/IdaSessionClient.ts`
- [GDB Sessions](https://github.com/anusreesunilkumar/rea/blob/main/src/gdb/GdbSessionManager.ts): `src/gdb/GdbSessionManager.ts`
- [Rizin Sessions](https://github.com/anusreesunilkumar/rea/blob/main/src/rizin/RizinDebugSessionManager.ts): `src/rizin/RizinDebugSessionManager.ts`
- [Cutter Bridge](https://github.com/anusreesunilkumar/rea/blob/main/src/cutter/CutterBridgeClient.ts): `src/cutter/CutterBridgeClient.ts`

### Results and Runtime

- [Evidence Records](https://github.com/anusreesunilkumar/rea/blob/main/src/domain/evidence.ts): `src/domain/evidence.ts`
- [Capture Storage](https://github.com/anusreesunilkumar/rea/blob/main/src/browser/CdpCaptureStorage.ts): `src/browser/CdpCaptureStorage.ts`
- [Scenario Storage](https://github.com/anusreesunilkumar/rea/blob/main/src/browser/PlaywrightScenarioStorage.ts): `src/browser/PlaywrightScenarioStorage.ts`
- [Error Projection](https://github.com/anusreesunilkumar/rea/blob/main/src/domain/analysisErrorProjection.ts): `src/domain/analysisErrorProjection.ts`
- [Provider Processes](https://github.com/anusreesunilkumar/rea/blob/main/src/process/ProviderProcess.ts): `src/process/ProviderProcess.ts`

### Other components

- **Agent**
- **Terminal User**

## Connections

- Agent → MCP Runtime: requests analysis (evidence: `README.md`)
- Terminal User → CLI: runs commands (evidence: `README.md`)
- MCP Runtime → Reverse Tools: registers tools
- CLI → Reverse Commands: dispatches commands
- Reverse Tools → Reverse Analysis: calls service (evidence: `src/server/registerReverseEngineeringTools.ts`)
- Reverse Commands → Reverse Analysis: calls service (evidence: `src/cli/reverseEngineeringCommands.ts`)
- Reverse Analysis → Evidence Records: creates findings (evidence: `src/application/reverse/ReverseEngineeringService.ts`)
- Reverse Analysis → Provider Processes: runs providers (evidence: `src/application/reverse/ReverseEngineeringService.ts`)
- Ghidra Provider → Provider Processes: manages process (evidence: `src/ghidra/GhidraClient.ts`)
- Hopper Provider → Provider Processes: manages process (evidence: `src/hopper/HopperClient.ts`)
- GDB Sessions → Provider Processes: manages process (evidence: `src/gdb/GdbSessionManager.ts`)
- Rizin Sessions → Provider Processes: manages process (evidence: `src/rizin/RizinDebugSessionManager.ts`)
- Browser Observation → Capture Storage: stores captures
- Browser Scenarios → Scenario Storage: stores scenarios
- Reverse Analysis → Error Projection: returns failures
