# ose-jossy/re-engineer-anything architecture

> Architecture diagram of the GitHub repository ose-jossy/re-engineer-anything, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ose-jossy/re-engineer-anything
- Repository: https://github.com/ose-jossy/re-engineer-anything

## Overview

REA is a local reverse-engineering MCP server and CLI. The principal workflow is an agent or terminal user submitting an analysis request, tool registration dispatching it to an application service, and a provider inspecting the target; findings are returned with evidence and limitations. The repository also documents JavaScript/Electron, website, Android, and offline binary analysis. The excerpts and index establish several native-service connections, but not the wiring for every documented capability, so those branches are shown without asserted call edges.

Main entry points: [`src/server/registerReverseEngineeringTools.ts`](https://github.com/ose-jossy/re-engineer-anything/blob/main/src/server/registerReverseEngineeringTools.ts) (Reverse tool registration), [`src/application/reverse/ReverseEngineeringService.ts`](https://github.com/ose-jossy/re-engineer-anything/blob/main/src/application/reverse/ReverseEngineeringService.ts) (Analysis orchestration), [`src/cli/reverseEngineeringCommands.ts`](https://github.com/ose-jossy/re-engineer-anything/blob/main/src/cli/reverseEngineeringCommands.ts) (CLI commands), [`src/composition/reverseEngineering.ts`](https://github.com/ose-jossy/re-engineer-anything/blob/main/src/composition/reverseEngineering.ts) (Provider composition)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry points"]
  node_main["MCP server startup<br/>[main.ts]"]
  node_cli["CLI commands"]
  node_registration["Reverse tool registration"]
end

subgraph group_workflow["Analysis workflow"]
  node_contracts["Tool contracts"]
  node_service["Analysis orchestration"]
  node_composition["Provider composition"]
end

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

subgraph group_capabilities["Analysis capabilities"]
  node_javascript["JavaScript analysis"]
  node_browser["Browser observation"]
  node_android["Android analysis<br/>[JadxProvider.ts]"]
  node_sqlite["SQLite inspection"]
  node_offline["Offline ELF analysis"]
end

subgraph group_domain["Shared domain"]
  node_evidence["Evidence records<br/>[evidence.ts]"]
  node_errors["Error projection"]
end

node_agent(("Agent"))
node_terminal(("Terminal user"))

node_agent -->|"requests analysis"| node_main
node_terminal -->|"runs commands"| node_cli
node_main -.->|"serves tools"| node_registration
node_registration -->|"dispatches requests"| node_service
node_cli -->|"invokes workflows"| node_service
node_service -->|"uses provider port"| node_composition
node_composition -.->|"configures provider"| node_ghidra
node_composition -.->|"configures provider"| node_hopper
node_service -->|"returns findings"| node_evidence
node_registration -->|"uses contracts"| node_contracts
node_registration -->|"projects failures"| node_errors
node_cli -->|"projects failures"| node_errors
node_agent -.->|"requests app analysis"| node_javascript
node_agent -.->|"requests site analysis"| node_browser
node_agent -.->|"requests Android analysis"| node_android
node_agent -.->|"requests ELF analysis"| node_offline

click node_main "https://github.com/ose-jossy/re-engineer-anything/blob/main/src/main.ts"
click node_cli "https://github.com/ose-jossy/re-engineer-anything/blob/main/src/cli/reverseEngineeringCommands.ts"
click node_registration "https://github.com/ose-jossy/re-engineer-anything/blob/main/src/server/registerReverseEngineeringTools.ts"
click node_contracts "https://github.com/ose-jossy/re-engineer-anything/blob/main/src/contracts/reverseEngineeringToolContracts.ts"
click node_service "https://github.com/ose-jossy/re-engineer-anything/blob/main/src/application/reverse/ReverseEngineeringService.ts"
click node_composition "https://github.com/ose-jossy/re-engineer-anything/blob/main/src/composition/reverseEngineering.ts"
click node_evidence "https://github.com/ose-jossy/re-engineer-anything/blob/main/src/domain/evidence.ts"
click node_errors "https://github.com/ose-jossy/re-engineer-anything/blob/main/src/domain/analysisErrorProjection.ts"
click node_ghidra "https://github.com/ose-jossy/re-engineer-anything/blob/main/src/ghidra/GhidraClient.ts"
click node_hopper "https://github.com/ose-jossy/re-engineer-anything/blob/main/src/hopper/HopperClient.ts"
click node_ida "https://github.com/ose-jossy/re-engineer-anything/blob/main/src/ida/IdaSessionClient.ts"
click node_cutter "https://github.com/ose-jossy/re-engineer-anything/blob/main/src/cutter/CutterBridgeClient.ts"
click node_debuggers "https://github.com/ose-jossy/re-engineer-anything/blob/main/src/gdb/GdbSessionManager.ts"
click node_rizin "https://github.com/ose-jossy/re-engineer-anything/blob/main/src/rizin/RizinDebugSessionManager.ts"
click node_javascript "https://github.com/ose-jossy/re-engineer-anything/blob/main/src/javascript/analysis/JavaScriptAnalysisWorker.ts"
click node_browser "https://github.com/ose-jossy/re-engineer-anything/blob/main/src/application/BrowserObservationService.ts"
click node_android "https://github.com/ose-jossy/re-engineer-anything/blob/main/src/android/JadxProvider.ts"
click node_sqlite "https://github.com/ose-jossy/re-engineer-anything/blob/main/src/sqlite/SqliteDatabaseInspection.ts"
click node_offline "https://github.com/ose-jossy/re-engineer-anything/tree/main/src/application"

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_main,node_cli,node_registration,node_terminal toneBlue
class node_contracts,node_service,node_composition toneAmber
class node_ghidra,node_hopper,node_ida,node_cutter,node_debuggers,node_rizin toneMint
class node_javascript,node_browser,node_android,node_sqlite,node_offline toneRose
class node_evidence,node_errors,node_agent toneIndigo
```

## Components

### Entry points

- [MCP server startup](https://github.com/ose-jossy/re-engineer-anything/blob/main/src/main.ts): `src/main.ts`
- [CLI commands](https://github.com/ose-jossy/re-engineer-anything/blob/main/src/cli/reverseEngineeringCommands.ts): `src/cli/reverseEngineeringCommands.ts`
- [Reverse tool registration](https://github.com/ose-jossy/re-engineer-anything/blob/main/src/server/registerReverseEngineeringTools.ts): `src/server/registerReverseEngineeringTools.ts`

### Analysis workflow

- [Tool contracts](https://github.com/ose-jossy/re-engineer-anything/blob/main/src/contracts/reverseEngineeringToolContracts.ts): `src/contracts/reverseEngineeringToolContracts.ts`
- [Analysis orchestration](https://github.com/ose-jossy/re-engineer-anything/blob/main/src/application/reverse/ReverseEngineeringService.ts): `src/application/reverse/ReverseEngineeringService.ts`
- [Provider composition](https://github.com/ose-jossy/re-engineer-anything/blob/main/src/composition/reverseEngineering.ts): `src/composition/reverseEngineering.ts`

### Analysis providers

- [Ghidra adapter](https://github.com/ose-jossy/re-engineer-anything/blob/main/src/ghidra/GhidraClient.ts): `src/ghidra/GhidraClient.ts`
- [Hopper adapter](https://github.com/ose-jossy/re-engineer-anything/blob/main/src/hopper/HopperClient.ts): `src/hopper/HopperClient.ts`
- [IDA adapter](https://github.com/ose-jossy/re-engineer-anything/blob/main/src/ida/IdaSessionClient.ts): `src/ida/IdaSessionClient.ts`
- [Cutter adapter](https://github.com/ose-jossy/re-engineer-anything/blob/main/src/cutter/CutterBridgeClient.ts): `src/cutter/CutterBridgeClient.ts`
- [Debug sessions](https://github.com/ose-jossy/re-engineer-anything/blob/main/src/gdb/GdbSessionManager.ts): `src/gdb/GdbSessionManager.ts`
- [Rizin sessions](https://github.com/ose-jossy/re-engineer-anything/blob/main/src/rizin/RizinDebugSessionManager.ts): `src/rizin/RizinDebugSessionManager.ts`

### Analysis capabilities

- [JavaScript analysis](https://github.com/ose-jossy/re-engineer-anything/blob/main/src/javascript/analysis/JavaScriptAnalysisWorker.ts): `src/javascript/analysis/JavaScriptAnalysisWorker.ts`
- [Browser observation](https://github.com/ose-jossy/re-engineer-anything/blob/main/src/application/BrowserObservationService.ts): `src/application/BrowserObservationService.ts`
- [Android analysis](https://github.com/ose-jossy/re-engineer-anything/blob/main/src/android/JadxProvider.ts): `src/android/JadxProvider.ts`
- [SQLite inspection](https://github.com/ose-jossy/re-engineer-anything/blob/main/src/sqlite/SqliteDatabaseInspection.ts): `src/sqlite/SqliteDatabaseInspection.ts`
- [Offline ELF analysis](https://github.com/ose-jossy/re-engineer-anything/tree/main/src/application): `src/application`

### Shared domain

- [Evidence records](https://github.com/ose-jossy/re-engineer-anything/blob/main/src/domain/evidence.ts): `src/domain/evidence.ts`
- [Error projection](https://github.com/ose-jossy/re-engineer-anything/blob/main/src/domain/analysisErrorProjection.ts): `src/domain/analysisErrorProjection.ts`

### Other components

- **Agent**
- **Terminal user**

## Connections

- Agent → MCP server startup: requests analysis (evidence: `README.md`)
- Terminal user → CLI commands: runs commands (evidence: `README.md`)
- MCP server startup → Reverse tool registration: serves tools
- Reverse tool registration → Analysis orchestration: dispatches requests (evidence: `src/server/registerReverseEngineeringTools.ts`)
- CLI commands → Analysis orchestration: invokes workflows (evidence: `src/cli/reverseEngineeringCommands.ts`)
- Analysis orchestration → Provider composition: uses provider port (evidence: `src/composition/reverseEngineering.ts`)
- Provider composition → Ghidra adapter: configures provider
- Provider composition → Hopper adapter: configures provider
- Analysis orchestration → Evidence records: returns findings (evidence: `src/application/reverse/ReverseEngineeringService.ts`)
- Reverse tool registration → Tool contracts: uses contracts (evidence: `src/server/registerReverseEngineeringTools.ts`)
- Reverse tool registration → Error projection: projects failures (evidence: `src/server/registerReverseEngineeringTools.ts`)
- CLI commands → Error projection: projects failures (evidence: `src/cli/reverseEngineeringCommands.ts`)
- Agent → JavaScript analysis: requests app analysis
- Agent → Browser observation: requests site analysis
- Agent → Android analysis: requests Android analysis
- Agent → Offline ELF analysis: requests ELF analysis (evidence: `README.md`)
