# avvud/rea architecture

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

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

## Overview

REA is a local reverse-engineering toolkit exposed through MCP and CLI workflows. An agent or terminal user selects a target; REA routes analysis to suitable provider or application-inspection capabilities and returns findings with evidence and limitations. The README documents native, JavaScript/Electron, .NET, and website analysis; the tree also shows Android tooling and browser observation. The sampled sources establish several provider and reverse-engineering relationships, but not all runtime routing, so undocumented connections are omitted.

Main entry points: [`src/application/reverse/ReverseEngineeringService.ts`](https://github.com/avvud/rea/blob/main/src/application/reverse/ReverseEngineeringService.ts) (Reverse service), [`src/server/registerReverseEngineeringTools.ts`](https://github.com/avvud/rea/blob/main/src/server/registerReverseEngineeringTools.ts) (Tool registration), [`src/composition/reverseEngineering.ts`](https://github.com/avvud/rea/blob/main/src/composition/reverseEngineering.ts) (Provider composition), [`src/main.ts`](https://github.com/avvud/rea/blob/main/src/main.ts) (MCP server)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry points"]
  node_mcp["MCP server<br/>[main.ts]"]
  node_cli["CLI commands"]
  node_toolreg["Tool registration"]
end

subgraph group_orchestration["Analysis orchestration"]
  node_reverse["Reverse service"]
  node_composition["Provider composition"]
  node_contracts["Tool contracts"]
  node_evidence["Evidence model<br/>[evidence.ts]"]
  node_errors["Error projection"]
end

subgraph group_providers["Analysis providers"]
  node_ghidra["Ghidra analysis<br/>[GhidraClient.ts]"]
  node_hopper["Hopper analysis<br/>[HopperClient.ts]"]
  node_ida["IDA analysis"]
  node_kuna["Kuna analysis"]
  node_debuggers["Debug sessions"]
  node_rizin["Rizin sessions"]
end

subgraph group_inspection["Application inspection"]
  node_android["Android analysis<br/>[JadxProvider.ts]"]
  node_javascript["JavaScript analysis"]
  node_browser["Browser observation"]
  node_scenario["Browser scenarios"]
  node_sqlite["SQLite inspection"]
end

node_agent(("Agent or user"))

node_agent -->|"asks via MCP"| node_mcp
node_agent -->|"uses terminal"| node_cli
node_mcp -.->|"serves tools"| node_toolreg
node_cli -->|"invokes"| node_reverse
node_toolreg -->|"calls"| node_reverse
node_reverse -->|"uses providers"| node_composition
node_toolreg -->|"uses schemas"| node_contracts
node_reverse -->|"produces findings"| node_evidence
node_toolreg -->|"projects errors"| node_errors
node_composition -.->|"configures"| node_ghidra
node_composition -.->|"configures"| node_hopper
node_composition -.->|"configures"| node_ida
node_reverse -.->|"supports sessions"| node_debuggers
node_reverse -.->|"supports sessions"| node_rizin
node_agent -->|"requests analysis"| node_android
node_agent -->|"requests analysis"| node_javascript
node_agent -.->|"requests inspection"| node_browser
node_agent -.->|"requests capture"| node_scenario
node_agent -.->|"requests inspection"| node_sqlite

click node_mcp "https://github.com/avvud/rea/blob/main/src/main.ts"
click node_cli "https://github.com/avvud/rea/blob/main/src/cli/reverseEngineeringCommands.ts"
click node_toolreg "https://github.com/avvud/rea/blob/main/src/server/registerReverseEngineeringTools.ts"
click node_reverse "https://github.com/avvud/rea/blob/main/src/application/reverse/ReverseEngineeringService.ts"
click node_composition "https://github.com/avvud/rea/blob/main/src/composition/reverseEngineering.ts"
click node_contracts "https://github.com/avvud/rea/blob/main/src/contracts/reverseEngineeringToolContracts.ts"
click node_evidence "https://github.com/avvud/rea/blob/main/src/domain/evidence.ts"
click node_errors "https://github.com/avvud/rea/blob/main/src/domain/analysisErrorProjection.ts"
click node_ghidra "https://github.com/avvud/rea/blob/main/src/ghidra/GhidraClient.ts"
click node_hopper "https://github.com/avvud/rea/blob/main/src/hopper/HopperClient.ts"
click node_ida "https://github.com/avvud/rea/blob/main/src/ida/IdaSessionClient.ts"
click node_kuna "https://github.com/avvud/rea/blob/main/src/kuna/KunaSessionClient.ts"
click node_debuggers "https://github.com/avvud/rea/blob/main/src/gdb/GdbSessionManager.ts"
click node_rizin "https://github.com/avvud/rea/blob/main/src/rizin/RizinDebugSessionManager.ts"
click node_android "https://github.com/avvud/rea/blob/main/src/android/JadxProvider.ts"
click node_javascript "https://github.com/avvud/rea/blob/main/src/javascript/analysis/JavaScriptAnalysisWorker.ts"
click node_browser "https://github.com/avvud/rea/blob/main/src/application/BrowserObservationService.ts"
click node_scenario "https://github.com/avvud/rea/blob/main/src/application/BrowserScenarioCaptureService.ts"
click node_sqlite "https://github.com/avvud/rea/blob/main/src/sqlite/SqliteDatabaseInspection.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_toolreg,node_agent toneBlue
class node_reverse,node_composition,node_contracts,node_evidence,node_errors toneAmber
class node_ghidra,node_hopper,node_ida,node_kuna,node_debuggers,node_rizin toneMint
class node_android,node_javascript,node_browser,node_scenario,node_sqlite toneRose
```

## Components

### Entry points

- [MCP server](https://github.com/avvud/rea/blob/main/src/main.ts): `src/main.ts`
- [CLI commands](https://github.com/avvud/rea/blob/main/src/cli/reverseEngineeringCommands.ts): `src/cli/reverseEngineeringCommands.ts`
- [Tool registration](https://github.com/avvud/rea/blob/main/src/server/registerReverseEngineeringTools.ts): `src/server/registerReverseEngineeringTools.ts`

### Analysis orchestration

- [Reverse service](https://github.com/avvud/rea/blob/main/src/application/reverse/ReverseEngineeringService.ts): `src/application/reverse/ReverseEngineeringService.ts`
- [Provider composition](https://github.com/avvud/rea/blob/main/src/composition/reverseEngineering.ts): `src/composition/reverseEngineering.ts`
- [Tool contracts](https://github.com/avvud/rea/blob/main/src/contracts/reverseEngineeringToolContracts.ts): `src/contracts/reverseEngineeringToolContracts.ts`
- [Evidence model](https://github.com/avvud/rea/blob/main/src/domain/evidence.ts): `src/domain/evidence.ts`
- [Error projection](https://github.com/avvud/rea/blob/main/src/domain/analysisErrorProjection.ts): `src/domain/analysisErrorProjection.ts`

### Analysis providers

- [Ghidra analysis](https://github.com/avvud/rea/blob/main/src/ghidra/GhidraClient.ts): `src/ghidra/GhidraClient.ts`
- [Hopper analysis](https://github.com/avvud/rea/blob/main/src/hopper/HopperClient.ts): `src/hopper/HopperClient.ts`
- [IDA analysis](https://github.com/avvud/rea/blob/main/src/ida/IdaSessionClient.ts): `src/ida/IdaSessionClient.ts`
- [Kuna analysis](https://github.com/avvud/rea/blob/main/src/kuna/KunaSessionClient.ts): `src/kuna/KunaSessionClient.ts`
- [Debug sessions](https://github.com/avvud/rea/blob/main/src/gdb/GdbSessionManager.ts): `src/gdb/GdbSessionManager.ts`
- [Rizin sessions](https://github.com/avvud/rea/blob/main/src/rizin/RizinDebugSessionManager.ts): `src/rizin/RizinDebugSessionManager.ts`

### Application inspection

- [Android analysis](https://github.com/avvud/rea/blob/main/src/android/JadxProvider.ts): `src/android/JadxProvider.ts`
- [JavaScript analysis](https://github.com/avvud/rea/blob/main/src/javascript/analysis/JavaScriptAnalysisWorker.ts): `src/javascript/analysis/JavaScriptAnalysisWorker.ts`
- [Browser observation](https://github.com/avvud/rea/blob/main/src/application/BrowserObservationService.ts): `src/application/BrowserObservationService.ts`
- [Browser scenarios](https://github.com/avvud/rea/blob/main/src/application/BrowserScenarioCaptureService.ts): `src/application/BrowserScenarioCaptureService.ts`
- [SQLite inspection](https://github.com/avvud/rea/blob/main/src/sqlite/SqliteDatabaseInspection.ts): `src/sqlite/SqliteDatabaseInspection.ts`

### Other components

- **Agent or user**

## Connections

- Agent or user → MCP server: asks via MCP (evidence: `README.md`)
- Agent or user → CLI commands: uses terminal (evidence: `README.md`)
- MCP server → Tool registration: serves tools
- CLI commands → Reverse service: invokes (evidence: `src/cli/reverseEngineeringCommands.ts`)
- Tool registration → Reverse service: calls (evidence: `src/server/registerReverseEngineeringTools.ts`)
- Reverse service → Provider composition: uses providers (evidence: `src/composition/reverseEngineering.ts`)
- Tool registration → Tool contracts: uses schemas (evidence: `src/server/registerReverseEngineeringTools.ts`)
- Reverse service → Evidence model: produces findings (evidence: `src/application/reverse/ReverseEngineeringService.ts`)
- Tool registration → Error projection: projects errors (evidence: `src/server/registerReverseEngineeringTools.ts`)
- Provider composition → Ghidra analysis: configures
- Provider composition → Hopper analysis: configures
- Provider composition → IDA analysis: configures
- Reverse service → Debug sessions: supports sessions
- Reverse service → Rizin sessions: supports sessions
- Agent or user → Android analysis: requests analysis (evidence: `README.md`)
- Agent or user → JavaScript analysis: requests analysis (evidence: `README.md`)
- Agent or user → Browser observation: requests inspection
- Agent or user → Browser scenarios: requests capture
- Agent or user → SQLite inspection: requests inspection
