# 0gc1/external-base architecture

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

- Interactive diagram: https://gitdiagram.com/0gc1/external-base
- Repository: https://github.com/0gc1/external-base

## Overview

Zeugenschutz Base is a Windows C++ Roblox external with a D3D9/ImGui overlay. Its runtime attaches to Roblox, fetches version-specific offsets, refreshes Roblox data, and renders ESP, watermark, and menu each frame; the menu also exposes player search and saved settings. The graph preserves the documented resolver, offset-provider, configuration, and device-loss capabilities. Some subsystem links rely on README documentation or the SOURCE INDEX; unsampled implementation details are not inferred.

Main entry points: [`src/main.cpp`](https://github.com/0gc1/external-base/blob/main/src/main.cpp) (Runtime loop), [`src/menu.cpp`](https://github.com/0gc1/external-base/blob/main/src/menu.cpp) (Tabbed menu), [`src/overlay.cpp`](https://github.com/0gc1/external-base/blob/main/src/overlay.cpp) (Overlay lifecycle), [`src/esp.cpp`](https://github.com/0gc1/external-base/blob/main/src/esp.cpp) (ESP rendering)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Runtime and data"]
  node_main["Runtime loop<br/>[main.cpp]"]
  node_memory["Process memory<br/>[mem.cpp]"]
  node_offsets["Offset loading<br/>[offsets.cpp]"]
  node_datamodel["DataModel walk<br/>[rbx.cpp]"]
  node_projection["World projection<br/>[rbx.cpp]"]
end

subgraph group_visuals["Overlay and visuals"]
  node_overlay["Overlay lifecycle<br/>[overlay.cpp]"]
  node_esp["ESP rendering<br/>[esp.cpp]"]
  node_watermark["Watermark<br/>[watermark.cpp]"]
end

subgraph group_interface["Menu and settings"]
  node_menu["Tabbed menu<br/>[menu.cpp]"]
  node_widgets["UI widgets<br/>[widgets.cpp]"]
  node_theme["Visual theme<br/>[theme.cpp]"]
  node_animation["UI animation<br/>[anim.cpp]"]
  node_config["Config persistence<br/>[config.cpp]"]
end

subgraph group_imgui["Dear ImGui"]
  node_imgui_core["ImGui core<br/>[imgui.cpp]"]
  node_imgui_draw["Drawing and fonts<br/>[imgui_draw.cpp]"]
  node_imgui_tables["Tables<br/>[imgui_tables.cpp]"]
  node_imgui_widgets["ImGui widgets<br/>[imgui_widgets.cpp]"]
  node_imgui_win32["Win32 backend"]
  node_imgui_dx9["D3D9 backend<br/>[imgui_impl_dx9.cpp]"]
  node_imgui_headers["ImGui headers<br/>[imgui.h]"]
  node_imgui_internal["Internal API<br/>[imgui_internal.h]"]
  node_imgui_config_header["ImGui configuration<br/>[imconfig.h]"]
  node_imgui_dx9_header["D3D9 API header<br/>[imgui_impl_dx9.h]"]
  node_imgui_win32_header["Win32 API header<br/>[imgui_impl_win32.h]"]
  node_imgui_stb["STB utilities<br/>[imstb_rectpack.h]"]
  node_imgui_textedit["Text editing<br/>[imstb_textedit.h]"]
  node_imgui_truetype["Font utilities<br/>[imstb_truetype.h]"]
end

node_user(("User"))
node_roblox["Roblox process"]
node_offset_service["Offset provider"]

node_user -->|"starts"| node_main
node_main -->|"attaches to"| node_memory
node_memory -->|"reads process"| node_roblox
node_main -->|"fetches offsets"| node_offsets
node_offsets -->|"requests version data"| node_offset_service
node_main -->|"creates overlay"| node_overlay
node_main -->|"refreshes and lists"| node_datamodel
node_datamodel -->|"reads process data"| node_memory
node_datamodel -->|"uses offsets"| node_offsets
node_datamodel -->|"provides player data"| node_projection
node_main -->|"draws player visuals"| node_esp
node_esp -->|"reads process data"| node_memory
node_esp -->|"uses offsets"| node_offsets
node_esp -->|"uses overlay state"| node_overlay
node_main -->|"draws watermark"| node_watermark
node_main -->|"draws menu"| node_menu
node_menu -->|"builds controls"| node_widgets
node_menu -->|"loads and saves"| node_config
node_menu -->|"uses theme"| node_theme
node_menu -->|"uses animation"| node_animation
node_config -->|"persists settings"| node_esp
node_config -->|"persists settings"| node_watermark
node_overlay -->|"applies theme"| node_theme
node_overlay -->|"initializes backend"| node_imgui_win32
node_overlay -->|"initializes and renders"| node_imgui_dx9
node_overlay -->|"creates context and frames"| node_imgui_core
node_menu -->|"uses tables"| node_imgui_tables
node_widgets -->|"uses internal API"| node_imgui_internal
node_imgui_core -->|"implements API"| node_imgui_headers
node_imgui_draw -->|"uses internals"| node_imgui_internal
node_imgui_tables -->|"uses internals"| node_imgui_internal
node_imgui_widgets -->|"uses internals"| node_imgui_internal
node_imgui_win32 -->|"uses API"| node_imgui_headers
node_imgui_dx9 -->|"uses API"| node_imgui_headers
node_imgui_dx9 -->|"implements backend API"| node_imgui_dx9_header
node_imgui_win32 -->|"implements backend API"| node_imgui_win32_header
node_imgui_headers -->|"includes configuration"| node_imgui_config_header
node_imgui_draw -->|"uses utility"| node_imgui_stb
node_imgui_draw -->|"uses font utility"| node_imgui_truetype
node_imgui_core -.->|"uses utility"| node_imgui_textedit

click node_main "https://github.com/0gc1/external-base/blob/main/src/main.cpp"
click node_memory "https://github.com/0gc1/external-base/blob/main/src/mem.cpp"
click node_offsets "https://github.com/0gc1/external-base/blob/main/src/offsets.cpp"
click node_datamodel "https://github.com/0gc1/external-base/blob/main/src/rbx.cpp"
click node_projection "https://github.com/0gc1/external-base/blob/main/src/rbx.cpp"
click node_overlay "https://github.com/0gc1/external-base/blob/main/src/overlay.cpp"
click node_esp "https://github.com/0gc1/external-base/blob/main/src/esp.cpp"
click node_watermark "https://github.com/0gc1/external-base/blob/main/src/watermark.cpp"
click node_menu "https://github.com/0gc1/external-base/blob/main/src/menu.cpp"
click node_widgets "https://github.com/0gc1/external-base/blob/main/src/widgets.cpp"
click node_theme "https://github.com/0gc1/external-base/blob/main/src/theme.cpp"
click node_animation "https://github.com/0gc1/external-base/blob/main/src/anim.cpp"
click node_config "https://github.com/0gc1/external-base/blob/main/src/config.cpp"
click node_imgui_core "https://github.com/0gc1/external-base/blob/main/src/lib/imgui/imgui.cpp"
click node_imgui_draw "https://github.com/0gc1/external-base/blob/main/src/lib/imgui/imgui_draw.cpp"
click node_imgui_tables "https://github.com/0gc1/external-base/blob/main/src/lib/imgui/imgui_tables.cpp"
click node_imgui_widgets "https://github.com/0gc1/external-base/blob/main/src/lib/imgui/imgui_widgets.cpp"
click node_imgui_win32 "https://github.com/0gc1/external-base/blob/main/src/lib/imgui/imgui_impl_win32.cpp"
click node_imgui_dx9 "https://github.com/0gc1/external-base/blob/main/src/lib/imgui/imgui_impl_dx9.cpp"
click node_imgui_headers "https://github.com/0gc1/external-base/blob/main/src/lib/imgui/imgui.h"
click node_imgui_internal "https://github.com/0gc1/external-base/blob/main/src/lib/imgui/imgui_internal.h"
click node_imgui_config_header "https://github.com/0gc1/external-base/blob/main/src/lib/imgui/imconfig.h"
click node_imgui_dx9_header "https://github.com/0gc1/external-base/blob/main/src/lib/imgui/imgui_impl_dx9.h"
click node_imgui_win32_header "https://github.com/0gc1/external-base/blob/main/src/lib/imgui/imgui_impl_win32.h"
click node_imgui_stb "https://github.com/0gc1/external-base/blob/main/src/lib/imgui/imstb_rectpack.h"
click node_imgui_textedit "https://github.com/0gc1/external-base/blob/main/src/lib/imgui/imstb_textedit.h"
click node_imgui_truetype "https://github.com/0gc1/external-base/blob/main/src/lib/imgui/imstb_truetype.h"

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_memory,node_offsets,node_datamodel,node_projection,node_user toneBlue
class node_overlay,node_esp,node_watermark toneAmber
class node_menu,node_widgets,node_theme,node_animation,node_config toneMint
class node_imgui_core,node_imgui_draw,node_imgui_tables,node_imgui_widgets,node_imgui_win32,node_imgui_dx9,node_imgui_headers,node_imgui_internal,node_imgui_config_header,node_imgui_dx9_header,node_imgui_win32_header,node_imgui_stb,node_imgui_textedit,node_imgui_truetype toneRose
class node_roblox,node_offset_service toneIndigo
```

## Components

### Runtime and data

- [Runtime loop](https://github.com/0gc1/external-base/blob/main/src/main.cpp): `src/main.cpp`
- [Process memory](https://github.com/0gc1/external-base/blob/main/src/mem.cpp): `src/mem.cpp`
- [Offset loading](https://github.com/0gc1/external-base/blob/main/src/offsets.cpp): `src/offsets.cpp`
- [DataModel walk](https://github.com/0gc1/external-base/blob/main/src/rbx.cpp): `src/rbx.cpp`
- [World projection](https://github.com/0gc1/external-base/blob/main/src/rbx.cpp): `src/rbx.cpp`

### Overlay and visuals

- [Overlay lifecycle](https://github.com/0gc1/external-base/blob/main/src/overlay.cpp): `src/overlay.cpp`
- [ESP rendering](https://github.com/0gc1/external-base/blob/main/src/esp.cpp): `src/esp.cpp`
- [Watermark](https://github.com/0gc1/external-base/blob/main/src/watermark.cpp): `src/watermark.cpp`

### Menu and settings

- [Tabbed menu](https://github.com/0gc1/external-base/blob/main/src/menu.cpp): `src/menu.cpp`
- [UI widgets](https://github.com/0gc1/external-base/blob/main/src/widgets.cpp): `src/widgets.cpp`
- [Visual theme](https://github.com/0gc1/external-base/blob/main/src/theme.cpp): `src/theme.cpp`
- [UI animation](https://github.com/0gc1/external-base/blob/main/src/anim.cpp): `src/anim.cpp`
- [Config persistence](https://github.com/0gc1/external-base/blob/main/src/config.cpp): `src/config.cpp`

### Dear ImGui

- [ImGui core](https://github.com/0gc1/external-base/blob/main/src/lib/imgui/imgui.cpp): `src/lib/imgui/imgui.cpp`
- [Drawing and fonts](https://github.com/0gc1/external-base/blob/main/src/lib/imgui/imgui_draw.cpp): `src/lib/imgui/imgui_draw.cpp`
- [Tables](https://github.com/0gc1/external-base/blob/main/src/lib/imgui/imgui_tables.cpp): `src/lib/imgui/imgui_tables.cpp`
- [ImGui widgets](https://github.com/0gc1/external-base/blob/main/src/lib/imgui/imgui_widgets.cpp): `src/lib/imgui/imgui_widgets.cpp`
- [Win32 backend](https://github.com/0gc1/external-base/blob/main/src/lib/imgui/imgui_impl_win32.cpp): `src/lib/imgui/imgui_impl_win32.cpp`
- [D3D9 backend](https://github.com/0gc1/external-base/blob/main/src/lib/imgui/imgui_impl_dx9.cpp): `src/lib/imgui/imgui_impl_dx9.cpp`
- [ImGui headers](https://github.com/0gc1/external-base/blob/main/src/lib/imgui/imgui.h): `src/lib/imgui/imgui.h`
- [Internal API](https://github.com/0gc1/external-base/blob/main/src/lib/imgui/imgui_internal.h): `src/lib/imgui/imgui_internal.h`
- [ImGui configuration](https://github.com/0gc1/external-base/blob/main/src/lib/imgui/imconfig.h): `src/lib/imgui/imconfig.h`
- [D3D9 API header](https://github.com/0gc1/external-base/blob/main/src/lib/imgui/imgui_impl_dx9.h): `src/lib/imgui/imgui_impl_dx9.h`
- [Win32 API header](https://github.com/0gc1/external-base/blob/main/src/lib/imgui/imgui_impl_win32.h): `src/lib/imgui/imgui_impl_win32.h`
- [STB utilities](https://github.com/0gc1/external-base/blob/main/src/lib/imgui/imstb_rectpack.h): `src/lib/imgui/imstb_rectpack.h`
- [Text editing](https://github.com/0gc1/external-base/blob/main/src/lib/imgui/imstb_textedit.h): `src/lib/imgui/imstb_textedit.h`
- [Font utilities](https://github.com/0gc1/external-base/blob/main/src/lib/imgui/imstb_truetype.h): `src/lib/imgui/imstb_truetype.h`

### Other components

- **User**
- **Roblox process**
- **Offset provider**

## Connections

- User → Runtime loop: starts (evidence: `README.md`)
- Runtime loop → Process memory: attaches to (evidence: `src/main.cpp`)
- Process memory → Roblox process: reads process (evidence: `README.md`)
- Runtime loop → Offset loading: fetches offsets (evidence: `src/main.cpp`)
- Offset loading → Offset provider: requests version data (evidence: `README.md`)
- Runtime loop → Overlay lifecycle: creates overlay (evidence: `src/main.cpp`)
- Runtime loop → DataModel walk: refreshes and lists (evidence: `src/main.cpp`)
- DataModel walk → Process memory: reads process data (evidence: `src/rbx.cpp`)
- DataModel walk → Offset loading: uses offsets (evidence: `src/rbx.cpp`)
- DataModel walk → World projection: provides player data (evidence: `src/rbx.cpp`)
- Runtime loop → ESP rendering: draws player visuals (evidence: `src/main.cpp`)
- ESP rendering → Process memory: reads process data (evidence: `src/esp.cpp`)
- ESP rendering → Offset loading: uses offsets (evidence: `src/esp.cpp`)
- ESP rendering → Overlay lifecycle: uses overlay state (evidence: `src/esp.cpp`)
- Runtime loop → Watermark: draws watermark (evidence: `src/main.cpp`)
- Runtime loop → Tabbed menu: draws menu (evidence: `src/main.cpp`)
- Tabbed menu → UI widgets: builds controls (evidence: `src/menu.cpp`)
- Tabbed menu → Config persistence: loads and saves (evidence: `src/menu.cpp`)
- Tabbed menu → Visual theme: uses theme (evidence: `src/menu.cpp`)
- Tabbed menu → UI animation: uses animation (evidence: `src/menu.cpp`)
- Config persistence → ESP rendering: persists settings (evidence: `src/config.cpp`)
- Config persistence → Watermark: persists settings (evidence: `src/config.cpp`)
- Overlay lifecycle → Visual theme: applies theme (evidence: `src/overlay.cpp`)
- Overlay lifecycle → Win32 backend: initializes backend (evidence: `src/overlay.cpp`)
- Overlay lifecycle → D3D9 backend: initializes and renders (evidence: `src/overlay.cpp`)
- Overlay lifecycle → ImGui core: creates context and frames (evidence: `src/overlay.cpp`)
- Tabbed menu → Tables: uses tables (evidence: `src/menu.cpp`)
- UI widgets → Internal API: uses internal API (evidence: `src/widgets.cpp`)
- ImGui core → ImGui headers: implements API (evidence: `src/lib/imgui/imgui.h`)
- Drawing and fonts → Internal API: uses internals (evidence: `src/lib/imgui/imgui_draw.cpp`)
- Tables → Internal API: uses internals (evidence: `src/lib/imgui/imgui_tables.cpp`)
- ImGui widgets → Internal API: uses internals (evidence: `src/lib/imgui/imgui_internal.h`)
- Win32 backend → ImGui headers: uses API (evidence: `src/lib/imgui/imgui_impl_win32.cpp`)
- D3D9 backend → ImGui headers: uses API (evidence: `src/lib/imgui/imgui_impl_dx9.cpp`)
- D3D9 backend → D3D9 API header: implements backend API (evidence: `src/lib/imgui/imgui_impl_dx9.cpp`)
- Win32 backend → Win32 API header: implements backend API (evidence: `src/lib/imgui/imgui_impl_win32.cpp`)
- ImGui headers → ImGui configuration: includes configuration (evidence: `src/lib/imgui/imgui.h`)
- Drawing and fonts → STB utilities: uses utility (evidence: `src/lib/imgui/imgui_draw.cpp`)
- Drawing and fonts → Font utilities: uses font utility (evidence: `src/lib/imgui/imgui_draw.cpp`)
- ImGui core → Text editing: uses utility
