# orhun/binsider architecture

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

- Interactive diagram: https://gitdiagram.com/orhun/binsider
- Repository: https://github.com/orhun/binsider

## Overview

Binsider is a terminal application for inspecting ELF binaries. The main workflow takes a binary path and options, loads file metadata and analysis data, then presents general, static, dynamic, strings, and hexdump views in an interactive TUI. The graph preserves the README’s analysis capabilities; several feature links are documented rather than directly evidenced by sampled implementation excerpts, so those edges are dashed.

Main entry points: [`src/tui/state.rs`](https://github.com/orhun/binsider/blob/main/src/tui/state.rs) (Application state), [`src/app.rs`](https://github.com/orhun/binsider/blob/main/src/app.rs) (Analyzer), [`src/elf/mod.rs`](https://github.com/orhun/binsider/blob/main/src/elf/mod.rs) (ELF parser), [`src/lib.rs`](https://github.com/orhun/binsider/blob/main/src/lib.rs) (Application entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Application flow"]
  node_cli["CLI options<br/>[args.rs]"]
  node_runtime_entry["Application entry<br/>[lib.rs]"]
end

subgraph group_analysis["Binary analysis"]
  node_analyzer["Analyzer<br/>[app.rs]"]
  node_file_info["File metadata<br/>[file.rs]"]
  node_elf_parser["ELF parser<br/>[mod.rs]"]
  node_elf_headers["ELF headers<br/>[header.rs]"]
  node_elf_dynamic["ELF dynamic data<br/>[dynamic.rs]"]
  node_elf_notes["ELF notes<br/>[notes.rs]"]
  node_elf_relocations["ELF relocations<br/>[relocations.rs]"]
  node_elf_symbols["ELF symbols<br/>[symbols.rs]"]
  node_strings["String extraction<br/>[app.rs]"]
  node_hexdump["Hexdump view<br/>[app.rs]"]
end

subgraph group_interface["Terminal interface"]
  node_tui["TUI lifecycle<br/>[mod.rs]"]
  node_events["Terminal events<br/>[event.rs]"]
  node_commands["Command mapping<br/>[command.rs]"]
  node_state["Application state<br/>[state.rs]"]
  node_renderer["View renderer<br/>[ui.rs]"]
  node_selectable_list["Selectable lists<br/>[list.rs]"]
  node_logo["Logo widget<br/>[logo.rs]"]
end

subgraph group_runtime["Dynamic analysis"]
  node_tracer["System call tracer<br/>[tracer.rs]"]
end

node_engineer(("Engineer"))

node_engineer -->|"supplies options"| node_cli
node_cli -->|"starts with"| node_runtime_entry
node_runtime_entry -->|"loads metadata"| node_file_info
node_runtime_entry -->|"constructs"| node_analyzer
node_analyzer -->|"reads file data"| node_file_info
node_analyzer -->|"parses ELF"| node_elf_parser
node_elf_parser -->|"builds headers"| node_elf_headers
node_elf_parser -->|"builds dynamic data"| node_elf_dynamic
node_elf_parser -->|"builds notes"| node_elf_notes
node_elf_parser -->|"builds relocations"| node_elf_relocations
node_elf_parser -->|"builds symbols"| node_elf_symbols
node_analyzer -->|"extracts strings"| node_strings
node_analyzer -->|"initializes hexdump"| node_hexdump
node_runtime_entry -->|"starts interface"| node_tui
node_tui -->|"receives events"| node_events
node_tui -->|"draws views"| node_renderer
node_runtime_entry -->|"initializes state"| node_state
node_state -->|"handles commands"| node_commands
node_state -->|"sends events"| node_events
node_renderer -->|"renders state"| node_state
node_renderer -->|"reads ELF data"| node_elf_parser
node_state -->|"uses list state"| node_selectable_list
node_state -->|"uses logo widget"| node_logo
node_state -->|"requests extraction"| node_strings
node_state -.->|"requests tracing"| node_tracer
node_engineer -.->|"inspects binary"| node_analyzer
node_analyzer -.->|"traces execution"| node_tracer
node_renderer -.->|"shows byte view"| node_hexdump

click node_cli "https://github.com/orhun/binsider/blob/main/src/args.rs"
click node_runtime_entry "https://github.com/orhun/binsider/blob/main/src/lib.rs"
click node_analyzer "https://github.com/orhun/binsider/blob/main/src/app.rs"
click node_file_info "https://github.com/orhun/binsider/blob/main/src/file.rs"
click node_elf_parser "https://github.com/orhun/binsider/blob/main/src/elf/mod.rs"
click node_elf_headers "https://github.com/orhun/binsider/blob/main/src/elf/header.rs"
click node_elf_dynamic "https://github.com/orhun/binsider/blob/main/src/elf/dynamic.rs"
click node_elf_notes "https://github.com/orhun/binsider/blob/main/src/elf/notes.rs"
click node_elf_relocations "https://github.com/orhun/binsider/blob/main/src/elf/relocations.rs"
click node_elf_symbols "https://github.com/orhun/binsider/blob/main/src/elf/symbols.rs"
click node_strings "https://github.com/orhun/binsider/blob/main/src/app.rs"
click node_hexdump "https://github.com/orhun/binsider/blob/main/src/app.rs"
click node_tui "https://github.com/orhun/binsider/blob/main/src/tui/mod.rs"
click node_events "https://github.com/orhun/binsider/blob/main/src/tui/event.rs"
click node_commands "https://github.com/orhun/binsider/blob/main/src/tui/command.rs"
click node_state "https://github.com/orhun/binsider/blob/main/src/tui/state.rs"
click node_renderer "https://github.com/orhun/binsider/blob/main/src/tui/ui.rs"
click node_selectable_list "https://github.com/orhun/binsider/blob/main/src/tui/widgets/list.rs"
click node_logo "https://github.com/orhun/binsider/blob/main/src/tui/widgets/logo.rs"
click node_tracer "https://github.com/orhun/binsider/blob/main/src/tracer.rs"

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_cli,node_runtime_entry toneBlue
class node_analyzer,node_file_info,node_elf_parser,node_elf_headers,node_elf_dynamic,node_elf_notes,node_elf_relocations,node_elf_symbols,node_strings,node_hexdump toneAmber
class node_tui,node_events,node_commands,node_state,node_renderer,node_selectable_list,node_logo toneMint
class node_tracer toneRose
class node_engineer toneIndigo
```

## Components

### Application flow

- [CLI options](https://github.com/orhun/binsider/blob/main/src/args.rs): `src/args.rs`
- [Application entry](https://github.com/orhun/binsider/blob/main/src/lib.rs): `src/lib.rs`

### Binary analysis

- [Analyzer](https://github.com/orhun/binsider/blob/main/src/app.rs): `src/app.rs`
- [File metadata](https://github.com/orhun/binsider/blob/main/src/file.rs): `src/file.rs`
- [ELF parser](https://github.com/orhun/binsider/blob/main/src/elf/mod.rs): `src/elf/mod.rs`
- [ELF headers](https://github.com/orhun/binsider/blob/main/src/elf/header.rs): `src/elf/header.rs`
- [ELF dynamic data](https://github.com/orhun/binsider/blob/main/src/elf/dynamic.rs): `src/elf/dynamic.rs`
- [ELF notes](https://github.com/orhun/binsider/blob/main/src/elf/notes.rs): `src/elf/notes.rs`
- [ELF relocations](https://github.com/orhun/binsider/blob/main/src/elf/relocations.rs): `src/elf/relocations.rs`
- [ELF symbols](https://github.com/orhun/binsider/blob/main/src/elf/symbols.rs): `src/elf/symbols.rs`
- [String extraction](https://github.com/orhun/binsider/blob/main/src/app.rs): `src/app.rs`
- [Hexdump view](https://github.com/orhun/binsider/blob/main/src/app.rs): `src/app.rs`

### Terminal interface

- [TUI lifecycle](https://github.com/orhun/binsider/blob/main/src/tui/mod.rs): `src/tui/mod.rs`
- [Terminal events](https://github.com/orhun/binsider/blob/main/src/tui/event.rs): `src/tui/event.rs`
- [Command mapping](https://github.com/orhun/binsider/blob/main/src/tui/command.rs): `src/tui/command.rs`
- [Application state](https://github.com/orhun/binsider/blob/main/src/tui/state.rs): `src/tui/state.rs`
- [View renderer](https://github.com/orhun/binsider/blob/main/src/tui/ui.rs): `src/tui/ui.rs`
- [Selectable lists](https://github.com/orhun/binsider/blob/main/src/tui/widgets/list.rs): `src/tui/widgets/list.rs`
- [Logo widget](https://github.com/orhun/binsider/blob/main/src/tui/widgets/logo.rs): `src/tui/widgets/logo.rs`

### Dynamic analysis

- [System call tracer](https://github.com/orhun/binsider/blob/main/src/tracer.rs): `src/tracer.rs`

### Other components

- **Engineer**

## Connections

- Engineer → CLI options: supplies options (evidence: `README.md`)
- CLI options → Application entry: starts with (evidence: `src/lib.rs`)
- Application entry → File metadata: loads metadata (evidence: `src/lib.rs`)
- Application entry → Analyzer: constructs (evidence: `src/lib.rs`)
- Analyzer → File metadata: reads file data (evidence: `src/app.rs`)
- Analyzer → ELF parser: parses ELF (evidence: `src/app.rs`)
- ELF parser → ELF headers: builds headers (evidence: `src/elf/mod.rs`)
- ELF parser → ELF dynamic data: builds dynamic data (evidence: `src/elf/mod.rs`)
- ELF parser → ELF notes: builds notes (evidence: `src/elf/mod.rs`)
- ELF parser → ELF relocations: builds relocations (evidence: `src/elf/mod.rs`)
- ELF parser → ELF symbols: builds symbols (evidence: `src/elf/mod.rs`)
- Analyzer → String extraction: extracts strings (evidence: `src/app.rs`)
- Analyzer → Hexdump view: initializes hexdump (evidence: `src/app.rs`)
- Application entry → TUI lifecycle: starts interface (evidence: `src/lib.rs`)
- TUI lifecycle → Terminal events: receives events (evidence: `src/tui/mod.rs`)
- TUI lifecycle → View renderer: draws views (evidence: `src/tui/mod.rs`)
- Application entry → Application state: initializes state (evidence: `src/lib.rs`)
- Application state → Command mapping: handles commands (evidence: `src/tui/state.rs`)
- Application state → Terminal events: sends events (evidence: `src/tui/state.rs`)
- View renderer → Application state: renders state (evidence: `src/tui/ui.rs`)
- View renderer → ELF parser: reads ELF data (evidence: `src/tui/ui.rs`)
- Application state → Selectable lists: uses list state (evidence: `src/tui/state.rs`)
- Application state → Logo widget: uses logo widget (evidence: `src/tui/state.rs`)
- Application state → String extraction: requests extraction (evidence: `src/tui/state.rs`)
- Application state → System call tracer: requests tracing
- Engineer → Analyzer: inspects binary (evidence: `README.md`)
- Analyzer → System call tracer: traces execution (evidence: `README.md`)
- View renderer → Hexdump view: shows byte view (evidence: `README.md`)
