# zarazaex69/rizin architecture

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

- Interactive diagram: https://gitdiagram.com/zarazaex69/rizin
- Repository: https://github.com/zarazaex69/rizin

## Overview

1. This repository is the Rizin reverse-engineering platform: a C-based framework plus a set of command-line tools. The architecture is centered on a shared library stack under `librz/`, with thin executables in `binrz/` and `librz/main/` wrapping the same core capabilities.

2. The top-level execution path is:
   user command line → `main`/tool entrypoint → `librz/core` → specialized subsystems such as binary loading, analysis, disassembly, debugging, search, or crypto.  
   The interactive `rizin` shell and the standalone tools (`rz-bin`, `rz-asm`, `rz-diff`, `rz-find`, `rz-hash`, `rz-run`, `rz-sign`, `rz-ar`, `rz-ax`) are frontends over this same backend.

3. `librz/core` is the orchestration layer. It owns the command interpreter, visual/TUI modes, project handling, command descriptions, and the glue that coordinates I/O, binary inspection, analysis, printing, flags, types, searches, debugging, and scripting. If you are drawing boundaries, this is the main “application brain” that connects all other modules.

4. `librz/io` is the abstraction layer for reading and writing data sources. It supports files, memory, pipes, sockets, HTTP, process/debug targets, archives, and special transport backends. This is the first major boundary after the core: everything else generally consumes bytes through IO descriptors, maps, and caches rather than touching the filesystem directly.

5. `librz/bin` handles binary-format parsing and object metadata. It contains format-specific loaders for ELF, PE/PE+, Mach-O, Java class files, PYC, WASM, DEX, minidumps, firmware/container formats, and many others. It also exposes symbols, sections, relocations, imports/exports, debug info, demangling, and file-type identification via the `magic` subsystem.

6. `librz/arch` is the analysis/disassembly umbrella. It includes architecture-independent analysis logic plus many ISA-specific implementations under `isa/`, `isa_gnu/`, `p/`, `asm/`, `analysis/`, and `parse/`. This layer converts bytes from `io`/`bin` into instructions, control-flow, comments, xrefs, function metadata, and platform-specific semantics.

7. The `librz/il` and ESIL-related code provide intermediate representations and symbolic evaluation. Rizin uses these layers to model instruction effects, validate/execute semantics, export graphs/strings/JSON, and support analysis beyond raw disassembly. This is a key bridge between architecture-specific decoding and higher-level reasoning in `core`.

8. `librz/debug` implements native and remote debugging backends. It includes platform-specific support for Linux, BSDs, macOS/XNU, Windows, QNX, GDB/WinDbg/KD-style protocols, breakpoints, memory maps, registers, traces, and coredumps. In architecture terms, debugging is another data source feeding the same core commands and visualizations, but through live process/control-plane APIs instead of static files.

9. Higher-level analysis services live in focused libraries: `librz/search` for byte/string/regex/hash/entropy/magic/crypto searches, `librz/flag` for named addresses and zones, `librz/type` for type and prototype modeling, `librz/reg` for register profiles and arenas, `librz/sign` for FLIRT signatures, `librz/hash` and `librz/crypto` for hashing/encryption primitives, and `librz/diff` for byte/line/unified comparisons. These are mostly leaf services consumed by core and arch/bin workflows.

10. `librz/util` is the shared foundation. It provides containers, strings, buffers, graphs, JSON/YAML-style structured data, threading, filesystem/process helpers, encodings, numeric utilities, and a bundled `sdb` key-value database implementation. Many other subsystems depend on util; it is the lowest-level internal dependency layer.

11. Plugins and generated tables are a major structural feature. Architecture-, format-, debug-, IO-, and crypto-capabilities are often organized as plugin-like modules under `p/`, `format/`, `native/`, `p_gnu/`, etc., while large `.sdb.txt` tables encode opcodes, syscalls, calling conventions, register profiles, and platform/type metadata. This makes the system data-driven and extensible without hard-coding every target in core logic.

12. External dependencies are mostly vendored or wrapped through Meson subprojects: capstone, zydis, tree-sitter, libzip, zlib/zstd/xz/lz4, pcre2, nettle, blake2/blake3, xxhash, yxml, softfloat, and platform/debug wrappers. The build is entirely Meson-based, with CI, cross-build, packaging, and test scaffolding spread across `test/`, `.github/`, `dist/`, and `subprojects/`. For an architecture diagram, treat build/test/distribution as a separate support plane around the runtime libraries and tools.

Main entry points: [`librz/core`](https://github.com/zarazaex69/rizin/tree/dev/librz/core) (Core), [`librz/util`](https://github.com/zarazaex69/rizin/tree/dev/librz/util) (Util), [`librz/bin`](https://github.com/zarazaex69/rizin/tree/dev/librz/bin) (Binary), [`librz/arch`](https://github.com/zarazaex69/rizin/tree/dev/librz/arch) (Arch)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontends["Frontends"]
  node_main_rizin["rizin<br/>CLI entrypoint<br/>[rizin.c]"]
  node_main_tools["Tool mains<br/>CLI wrappers"]
end

subgraph group_runtime["Runtime libs"]
  node_core["Core<br/>orchestrator"]
  node_io[("IO<br/>byte source")]
  node_bin[("Binary<br/>format layer")]
  node_arch["Arch<br/>decode/analyze"]
  node_il["IL / ESIL<br/>intermediate rep"]
  node_debug["Debug"]
  node_cons["Console<br/>tui/output"]
end

subgraph group_services["Services"]
  node_search["Search<br/>match services"]
  node_flag["Flags<br/>symbol map"]
  node_type["Types<br/>type system"]
  node_reg["Regs<br/>register model"]
  node_sign["Signatures<br/>sig db"]
  node_hash["Hash<br/>digest library"]
  node_crypto["Crypto"]
  node_diff["Diff<br/>comparison"]
  node_lang["Lang<br/>scripting"]
end

subgraph group_support["Support"]
  node_util["Util<br/>foundation"]
  node_build["Build<br/>meson/vendor<br/>[meson.build]"]
end

node_main_rizin -->|"starts"| node_core
node_main_tools -->|"wraps"| node_core
node_core -->|"uses"| node_io
node_core -->|"loads"| node_bin
node_core -->|"analyzes"| node_arch
node_core -->|"evaluates"| node_il
node_core -->|"drives"| node_debug
node_core -->|"searches"| node_search
node_core -->|"maps"| node_flag
node_core -->|"types"| node_type
node_core -->|"reads regs"| node_reg
node_core -->|"matches"| node_sign
node_core -->|"hashes"| node_hash
node_core -->|"cryptos"| node_crypto
node_core -->|"compares"| node_diff
node_core -->|"scripts"| node_lang
node_core -->|"renders"| node_cons
node_bin -->|"consumes"| node_io
node_bin -->|"builds on"| node_util
node_arch -->|"builds on"| node_util
node_il -->|"bridges"| node_arch
node_debug -->|"backed by"| node_io
node_search -->|"builds on"| node_util
node_type -->|"builds on"| node_util
node_reg -->|"builds on"| node_util
node_sign -->|"builds on"| node_util
node_hash -->|"builds on"| node_util
node_crypto -->|"builds on"| node_util
node_diff -->|"builds on"| node_util
node_lang -->|"builds on"| node_util
node_cons -->|"builds on"| node_util
node_build -->|"builds"| node_main_tools
node_build -->|"tests"| node_core

click node_main_rizin "https://github.com/zarazaex69/rizin/blob/dev/binrz/rizin/rizin.c"
click node_main_tools "https://github.com/zarazaex69/rizin/tree/dev/librz/main"
click node_core "https://github.com/zarazaex69/rizin/tree/dev/librz/core"
click node_io "https://github.com/zarazaex69/rizin/tree/dev/librz/io"
click node_bin "https://github.com/zarazaex69/rizin/tree/dev/librz/bin"
click node_arch "https://github.com/zarazaex69/rizin/tree/dev/librz/arch"
click node_il "https://github.com/zarazaex69/rizin/tree/dev/librz/il"
click node_debug "https://github.com/zarazaex69/rizin/tree/dev/librz/debug"
click node_cons "https://github.com/zarazaex69/rizin/tree/dev/librz/cons"
click node_search "https://github.com/zarazaex69/rizin/tree/dev/librz/search"
click node_flag "https://github.com/zarazaex69/rizin/tree/dev/librz/flag"
click node_type "https://github.com/zarazaex69/rizin/tree/dev/librz/type"
click node_reg "https://github.com/zarazaex69/rizin/tree/dev/librz/reg"
click node_sign "https://github.com/zarazaex69/rizin/tree/dev/librz/sign"
click node_hash "https://github.com/zarazaex69/rizin/tree/dev/librz/hash"
click node_crypto "https://github.com/zarazaex69/rizin/tree/dev/librz/crypto"
click node_diff "https://github.com/zarazaex69/rizin/tree/dev/librz/diff"
click node_lang "https://github.com/zarazaex69/rizin/tree/dev/librz/lang"
click node_util "https://github.com/zarazaex69/rizin/tree/dev/librz/util"
click node_build "https://github.com/zarazaex69/rizin/blob/dev/meson.build"

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_rizin,node_main_tools toneBlue
class node_core,node_io,node_bin,node_arch,node_il,node_debug,node_cons toneAmber
class node_search,node_flag,node_type,node_reg,node_sign,node_hash,node_crypto,node_diff,node_lang toneMint
class node_util,node_build toneRose
```

## Components

### Frontends

Interactive shell and standalone CLI entrypoints.

- [rizin](https://github.com/zarazaex69/rizin/blob/dev/binrz/rizin/rizin.c): CLI entrypoint · Interactive shell and primary user-facing executable. · `binrz/rizin/rizin.c`
- [Tool mains](https://github.com/zarazaex69/rizin/tree/dev/librz/main): CLI wrappers · Thin entrypoints for the standalone utilities. · `librz/main`

### Runtime libs

Core execution, data access, decoding, analysis, and live debug services.

- [Core](https://github.com/zarazaex69/rizin/tree/dev/librz/core): orchestrator · Command interpreter, UI modes, project handling, and glue for all major workflows. · `librz/core`
- [IO](https://github.com/zarazaex69/rizin/tree/dev/librz/io): byte source · Unified read/write abstraction over files, memory, pipes, sockets, processes, and remote transports. · `librz/io`
- [Binary](https://github.com/zarazaex69/rizin/tree/dev/librz/bin): format layer · Binary-format parsing, object metadata, sections, symbols, relocations, and file identification. · `librz/bin`
- [Arch](https://github.com/zarazaex69/rizin/tree/dev/librz/arch): decode/analyze · Architecture-specific decoding, analysis, assembly, parsing, and semantics. · `librz/arch`
- [IL / ESIL](https://github.com/zarazaex69/rizin/tree/dev/librz/il): intermediate rep · Intermediate representations, symbolic evaluation, validation, export, and VM-style execution. · `librz/il`
- [Debug](https://github.com/zarazaex69/rizin/tree/dev/librz/debug): debug backends · Native and remote debugging, registers, breakpoints, traces, and coredumps. · `librz/debug`
- [Console](https://github.com/zarazaex69/rizin/tree/dev/librz/cons): tui/output · Terminal rendering, input, paging, prompts, and visual display support. · `librz/cons`

### Services

Higher-level reusable analysis and utility libraries.

- [Search](https://github.com/zarazaex69/rizin/tree/dev/librz/search): match services · Byte, string, regex, entropy, hash, magic, and crypto-oriented searching. · `librz/search`
- [Flags](https://github.com/zarazaex69/rizin/tree/dev/librz/flag): symbol map · Named addresses, tags, zones, and related symbol organization. · `librz/flag`
- [Types](https://github.com/zarazaex69/rizin/tree/dev/librz/type): type system · Type, prototype, and ABI modeling plus parsers and serialization. · `librz/type`
- [Regs](https://github.com/zarazaex69/rizin/tree/dev/librz/reg): register model · Register profiles, arenas, and register value handling. · `librz/reg`
- [Signatures](https://github.com/zarazaex69/rizin/tree/dev/librz/sign): sig db · FLIRT-style signature creation, matching, and signature database handling. · `librz/sign`
- [Hash](https://github.com/zarazaex69/rizin/tree/dev/librz/hash): digest library · Hashing, entropy, fuzzy hash, and related digest algorithms. · `librz/hash`
- [Crypto](https://github.com/zarazaex69/rizin/tree/dev/librz/crypto): crypto library · Symmetric and encoding-style cryptographic primitives used by tools and searches. · `librz/crypto`
- [Diff](https://github.com/zarazaex69/rizin/tree/dev/librz/diff): comparison · Byte, line, and unified diff computation. · `librz/diff`
- [Lang](https://github.com/zarazaex69/rizin/tree/dev/librz/lang): scripting · Language and piping support for command execution and embedding. · `librz/lang`

### Support

Shared foundations, build, and packaging support.

- [Util](https://github.com/zarazaex69/rizin/tree/dev/librz/util): foundation · Core containers, strings, buffers, graphs, JSON, threading, filesystem, and sdb. · `librz/util`
- [Build](https://github.com/zarazaex69/rizin/blob/dev/meson.build): meson/vendor · Meson build files, subprojects, CI, packaging, and test scaffolding. · `meson.build`

## Connections

- rizin → Core: starts · Interactive shell enters the shared core orchestration layer.
- Tool mains → Core: wraps · Standalone tools invoke the same shared core/backend APIs.
- Core → IO: uses · Core reads and writes through the IO abstraction layer.
- Core → Binary: loads · Core opens binaries and consumes object metadata.
- Core → Arch: analyzes · Core dispatches disassembly and analysis workflows.
- Core → IL / ESIL: evaluates · Core uses IL/ESIL for semantics and symbolic reasoning.
- Core → Debug: drives · Core coordinates live debugging sessions and control flow.
- Core → Search: searches · Core exposes search commands over byte, string, and pattern services.
- Core → Flags: maps · Core manages address labels, zones, and annotations.
- Core → Types: types · Core surfaces type modeling and prototype information.
- Core → Regs: reads regs · Core and debug workflows use register profiles and state.
- Core → Signatures: matches · Core invokes signature matching for binary identification.
- Core → Hash: hashes · Core uses digest and entropy services.
- Core → Crypto: cryptos · Core exposes crypto-related commands and searches.
- Core → Diff: compares · Core routes diff-oriented workflows to the diff library.
- Core → Lang: scripts · Core delegates command execution and language integration.
- Core → Console: renders · Core uses console/TUI rendering for interactive modes.
- Binary → IO: consumes · Binary loaders inspect bytes through IO descriptors and maps.
- Binary → Util: builds on · Binary parsing depends on shared containers, buffers, and structured data.
- Arch → Util: builds on · Decoding and analysis share low-level utility types and helpers.
- IL / ESIL → Arch: bridges · IL is fed by architecture-specific decoding and semantics.
- Debug → IO: backed by · Debugging reuses IO transports for process and remote access.
- Search → Util: builds on · Search implementations use shared utility and string/regex primitives.
- Types → Util: builds on · Type modeling and parsing depend on shared utility code.
- Regs → Util: builds on · Register state and profiles rely on shared utility structures.
- Signatures → Util: builds on · Signature storage and matching use shared helpers and sdb data.
- Hash → Util: builds on · Hash algorithms depend on common utility primitives.
- Crypto → Util: builds on · Crypto code uses shared buffers, encodings, and helpers.
- Diff → Util: builds on · Diff algorithms use shared comparison and container support.
- Lang → Util: builds on · Scripting and piping use subprocess, strings, and I/O helpers.
- Console → Util: builds on · Console rendering uses shared drawing, text, and output helpers.
- Build → Tool mains: builds · Meson and packaging assemble the CLI executables and runtime libraries.
- Build → Core: tests · Build/test scaffolding validates core command behavior and integration.
