# krishna7123/rea_krishna architecture

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

- Interactive diagram: https://gitdiagram.com/krishna7123/rea_krishna
- Repository: https://github.com/krishna7123/rea_krishna

## Overview

REA is a local reverse-engineering toolkit exposed through MCP and a CLI. The documented workflow starts with an agent or terminal request, inspects a target using analysis tools, and returns findings with evidence and limitations. The source index confirms the reverse-engineering tool/service path and several provider clients; README capability branches are included, but their internal wiring is not asserted where source excerpts do not show it.

Main entry points: [`src/application/reverse/ReverseEngineeringService.ts`](https://github.com/krishna7123/rea_krishna/blob/main/src/application/reverse/ReverseEngineeringService.ts) (Reverse Service), [`src/server/registerReverseEngineeringTools.ts`](https://github.com/krishna7123/rea_krishna/blob/main/src/server/registerReverseEngineeringTools.ts) (Reverse Tools), [`src/main.ts`](https://github.com/krishna7123/rea_krishna/blob/main/src/main.ts) (MCP Server), [`src/cli/reverseEngineeringCommands.ts`](https://github.com/krishna7123/rea_krishna/blob/main/src/cli/reverseEngineeringCommands.ts) (Reverse CLI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interfaces["User Interfaces"]
  node_mcp["MCP Server<br/>[main.ts]"]
  node_mcp_tools["Reverse Tools"]
  node_cli["Reverse CLI"]
end

subgraph group_workflow["Analysis Workflow"]
  node_composition["Provider Composition"]
  node_service["Reverse Service"]
end

subgraph group_providers["Analysis Providers"]
  node_debuggers["Debugger Sessions"]
  node_hopper["Hopper Analysis<br/>[HopperClient.ts]"]
  node_ida["IDA Analysis"]
  node_kuna["Kuna Analysis"]
end

subgraph group_capabilities["Target Capabilities"]
  node_native["Native Analysis<br/>[GhidraClient.ts]"]
  node_javascript["JavaScript Analysis"]
  node_browser["Browser Analysis"]
  node_android["Android Analysis<br/>[JadxProvider.ts]"]
end

subgraph group_domain["Evidence and Errors"]
  node_evidence["Evidence Records<br/>[evidence.ts]"]
  node_errors["Typed Analysis Errors"]
  node_error_projection["Error Projection"]
end

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

node_agent -->|"requests analysis"| node_mcp
node_terminal -->|"runs commands"| node_cli
node_mcp_tools -->|"invokes"| node_service
node_cli -->|"invokes"| node_service
node_composition -->|"configures"| node_service
node_service -->|"returns evidence"| node_evidence
node_service -->|"uses errors"| node_errors
node_error_projection -->|"projects errors"| node_errors
node_mcp -.->|"registers tools"| node_mcp_tools
node_service -.->|"uses provider"| node_native
node_service -.->|"uses provider"| node_debuggers
node_service -.->|"uses provider"| node_hopper
node_service -.->|"uses provider"| node_ida
node_service -.->|"uses provider"| node_kuna
node_mcp_tools -.->|"offers analysis"| node_javascript
node_mcp_tools -.->|"offers analysis"| node_browser
node_mcp_tools -.->|"offers analysis"| node_android

click node_mcp "https://github.com/krishna7123/rea_krishna/blob/main/src/main.ts"
click node_mcp_tools "https://github.com/krishna7123/rea_krishna/blob/main/src/server/registerReverseEngineeringTools.ts"
click node_cli "https://github.com/krishna7123/rea_krishna/blob/main/src/cli/reverseEngineeringCommands.ts"
click node_composition "https://github.com/krishna7123/rea_krishna/blob/main/src/composition/reverseEngineering.ts"
click node_service "https://github.com/krishna7123/rea_krishna/blob/main/src/application/reverse/ReverseEngineeringService.ts"
click node_native "https://github.com/krishna7123/rea_krishna/blob/main/src/ghidra/GhidraClient.ts"
click node_debuggers "https://github.com/krishna7123/rea_krishna/blob/main/src/gdb/GdbSessionManager.ts"
click node_hopper "https://github.com/krishna7123/rea_krishna/blob/main/src/hopper/HopperClient.ts"
click node_ida "https://github.com/krishna7123/rea_krishna/blob/main/src/ida/IdaSessionClient.ts"
click node_kuna "https://github.com/krishna7123/rea_krishna/blob/main/src/kuna/KunaSessionClient.ts"
click node_javascript "https://github.com/krishna7123/rea_krishna/blob/main/src/javascript/analysis/JavaScriptAnalysisWorker.ts"
click node_browser "https://github.com/krishna7123/rea_krishna/blob/main/src/application/BrowserObservationService.ts"
click node_android "https://github.com/krishna7123/rea_krishna/blob/main/src/android/JadxProvider.ts"
click node_evidence "https://github.com/krishna7123/rea_krishna/blob/main/src/domain/evidence.ts"
click node_errors "https://github.com/krishna7123/rea_krishna/blob/main/src/domain/analysisErrorCore.ts"
click node_error_projection "https://github.com/krishna7123/rea_krishna/blob/main/src/domain/analysisErrorProjection.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_mcp_tools,node_cli,node_terminal toneBlue
class node_composition,node_service toneAmber
class node_debuggers,node_hopper,node_ida,node_kuna toneMint
class node_native,node_javascript,node_browser,node_android toneRose
class node_evidence,node_errors,node_error_projection,node_agent toneIndigo
```

## Components

### User Interfaces

- [MCP Server](https://github.com/krishna7123/rea_krishna/blob/main/src/main.ts): `src/main.ts`
- [Reverse Tools](https://github.com/krishna7123/rea_krishna/blob/main/src/server/registerReverseEngineeringTools.ts): `src/server/registerReverseEngineeringTools.ts`
- [Reverse CLI](https://github.com/krishna7123/rea_krishna/blob/main/src/cli/reverseEngineeringCommands.ts): `src/cli/reverseEngineeringCommands.ts`

### Analysis Workflow

- [Provider Composition](https://github.com/krishna7123/rea_krishna/blob/main/src/composition/reverseEngineering.ts): `src/composition/reverseEngineering.ts`
- [Reverse Service](https://github.com/krishna7123/rea_krishna/blob/main/src/application/reverse/ReverseEngineeringService.ts): `src/application/reverse/ReverseEngineeringService.ts`

### Analysis Providers

- [Debugger Sessions](https://github.com/krishna7123/rea_krishna/blob/main/src/gdb/GdbSessionManager.ts): `src/gdb/GdbSessionManager.ts`
- [Hopper Analysis](https://github.com/krishna7123/rea_krishna/blob/main/src/hopper/HopperClient.ts): `src/hopper/HopperClient.ts`
- [IDA Analysis](https://github.com/krishna7123/rea_krishna/blob/main/src/ida/IdaSessionClient.ts): `src/ida/IdaSessionClient.ts`
- [Kuna Analysis](https://github.com/krishna7123/rea_krishna/blob/main/src/kuna/KunaSessionClient.ts): `src/kuna/KunaSessionClient.ts`

### Target Capabilities

- [Native Analysis](https://github.com/krishna7123/rea_krishna/blob/main/src/ghidra/GhidraClient.ts): `src/ghidra/GhidraClient.ts`
- [JavaScript Analysis](https://github.com/krishna7123/rea_krishna/blob/main/src/javascript/analysis/JavaScriptAnalysisWorker.ts): `src/javascript/analysis/JavaScriptAnalysisWorker.ts`
- [Browser Analysis](https://github.com/krishna7123/rea_krishna/blob/main/src/application/BrowserObservationService.ts): `src/application/BrowserObservationService.ts`
- [Android Analysis](https://github.com/krishna7123/rea_krishna/blob/main/src/android/JadxProvider.ts): `src/android/JadxProvider.ts`

### Evidence and Errors

- [Evidence Records](https://github.com/krishna7123/rea_krishna/blob/main/src/domain/evidence.ts): `src/domain/evidence.ts`
- [Typed Analysis Errors](https://github.com/krishna7123/rea_krishna/blob/main/src/domain/analysisErrorCore.ts): `src/domain/analysisErrorCore.ts`
- [Error Projection](https://github.com/krishna7123/rea_krishna/blob/main/src/domain/analysisErrorProjection.ts): `src/domain/analysisErrorProjection.ts`

### Other components

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

## Connections

- Agent → MCP Server: requests analysis (evidence: `README.md`)
- Terminal User → Reverse CLI: runs commands (evidence: `README.md`)
- Reverse Tools → Reverse Service: invokes (evidence: `src/server/registerReverseEngineeringTools.ts`)
- Reverse CLI → Reverse Service: invokes (evidence: `src/cli/reverseEngineeringCommands.ts`)
- Provider Composition → Reverse Service: configures (evidence: `src/composition/reverseEngineering.ts`)
- Reverse Service → Evidence Records: returns evidence (evidence: `src/application/reverse/ReverseEngineeringService.ts`)
- Reverse Service → Typed Analysis Errors: uses errors (evidence: `src/application/reverse/ReverseEngineeringService.ts`)
- Error Projection → Typed Analysis Errors: projects errors (evidence: `src/domain/analysisErrorProjection.ts`)
- MCP Server → Reverse Tools: registers tools
- Reverse Service → Native Analysis: uses provider
- Reverse Service → Debugger Sessions: uses provider
- Reverse Service → Hopper Analysis: uses provider
- Reverse Service → IDA Analysis: uses provider
- Reverse Service → Kuna Analysis: uses provider
- Reverse Tools → JavaScript Analysis: offers analysis
- Reverse Tools → Browser Analysis: offers analysis
- Reverse Tools → Android Analysis: offers analysis
