# pszachary/lockdown-protocol-external architecture

> Architecture diagram of the GitHub repository pszachary/lockdown-protocol-external, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-07). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/pszachary/lockdown-protocol-external
- Repository: https://github.com/pszachary/lockdown-protocol-external

## Overview

##### Project type and purpose
- This is a native C++ “external” game-enhancement tool (an “external cheat/overlay”) that hooks into a running game process to read/write memory, applies various player/weapon/inventory hacks, and renders a real-time overlay (ESP, radar, menu) using DirectX11 + Dear ImGui.
- The README confirms it’s meant to be built locally and injected or run alongside the target game (Lockdown Protocol) to enable features like ESP, aimbot, infinite ammo, etc.

##### File structure
- Top-level:
- main.cpp – entry point, game loop setup
- config/ + config/config.json – JSON-based settings file
- ItemProperties.h, game_*.hpp, game_*.h – data structures and game-specific offsets/types
- util.hpp, mem.hpp, common.hpp – utilities for string ops, memory scanning/reading/writing
- nlohmann/ – JSON parsing library
- overlay/ – overlay rendering code with subdirs:
– dx11/ – DirectX11 hook and overlay implementation (moverlay.cpp/.h)
– imgui/ – Dear ImGui source and platform/renderer backends
- fonts/ – custom font resources for overlay
- radar.cpp/h, menu.cpp/h – feature-specific modules
- Visual Studio solution: protocol.sln, protocol.vcxproj*

##### README for additional insights
- Features section lists ~25 hack categories, each implemented as a module that reads/writes game memory.
- Default hotkeys, usage instructions, and code example are provided.

a. Main components:
1. Game Process Interface
– MemoryManager (mem.hpp)
– DataCache (data_cache.h)
– Game Data Models (game_structures.hpp, ItemProperties.h)
2. Feature Modules
– ESP Renderer (overlay/imgui + overlay/dx11)
– Radar Module (radar.cpp/h)
– Player Hacks (speed, god mode, stamina, etc.)
– Weapon Hacks (rapid fire, no recoil, etc.)
– Inventory Hacks
– Aimbot Module
3. UI Layer
– ImGui Menu (menu.cpp/h)
4. Configuration
– ConfigManager (nlohmann/json.hpp + config/config.json)
5. Input Handling
– Keybinds (keybinds.hpp + menu/input integration)
6. External Dependencies
– DirectX11 (overlay/dx11)
– Dear ImGui (overlay/imgui)
– nlohmann JSON
b. Relationships & interactions:
- On each frame tick in main.cpp, InputHandler reads hotkeys → toggles feature flags in FeatureManager.
- FeatureManager uses MemoryManager to read game state into GameData models.
- Depending on toggles, Feature modules read/write memory via MemoryManager.
- OverlayRenderer (DX11 hook + ImGui) draws ESP, radar, and menu, consuming GameData.
- ConfigManager loads/saves feature toggles and user settings from/to config.json.
c. Architectural patterns/design principles:
- Modular feature services: each hack is encapsulated in its own module (.cpp/.hpp).
- Single main loop coordinating input, game data polling, feature execution, and rendering.
- Separation of concerns: memory abstraction, feature logic, rendering, input, config.
d. Key technologies & libraries:
- C++17 (presumed)
- DirectX11 (hook + device context)
- Dear ImGui (UI and overlay)
- nlohmann/json (configuration)
- iconv (text encoding, if used)

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Entry Point
    MainLoop["Main Loop\n(main.cpp)"]:::core
    click MainLoop "https://github.com/pszachary/lockdown-protocol-external/blob/master/main.cpp"

    %% Game Process Interface
    subgraph "Game Process Interface"
        MemoryManager["MemoryManager\n(mem.hpp)"]:::core
        DataCache["DataCache\n(data_cache.h)"]:::core
        GameDataModels["Game Data Models\n(ItemProperties.h,\n game_structures.hpp,\n game_locations.h,\n game_function.hpp,\n ufield.hpp,\n uobject.hpp)"]:::core
    end
    click MemoryManager "https://github.com/pszachary/lockdown-protocol-external/blob/master/mem.hpp"
    click DataCache "https://github.com/pszachary/lockdown-protocol-external/blob/master/data_cache.h"

    %% Feature Modules
    subgraph "Feature Modules"
        ESPRenderer["ESP Renderer\n(moverlay.cpp/.h,\n imgui, overlay.h)"]:::feature
        RadarModule["Radar Module\n(radar.cpp/h)"]:::feature
        PlayerHacks["Player Hacks"]:::feature
        WeaponHacks["Weapon Hacks"]:::feature
        InventoryHacks["Inventory Hacks"]:::feature
        AimbotModule["Aimbot Module"]:::feature
    end
    click ESPRenderer "https://github.com/pszachary/lockdown-protocol-external/blob/master/overlay/dx11/moverlay.cpp"
    click ESPRenderer "https://github.com/pszachary/lockdown-protocol-external/blob/master/overlay/overlay.h"
    click RadarModule "https://github.com/pszachary/lockdown-protocol-external/blob/master/radar.cpp"
    click RadarModule "https://github.com/pszachary/lockdown-protocol-external/blob/master/radar.h"

    %% UI Layer
    subgraph "UI Layer"
        ImGuiMenu["ImGui Menu\n(menu.cpp/h)"]:::ui
    end
    click ImGuiMenu "https://github.com/pszachary/lockdown-protocol-external/blob/master/menu.cpp"
    click ImGuiMenu "https://github.com/pszachary/lockdown-protocol-external/blob/master/menu.h"

    %% Configuration
    subgraph "Configuration"
        ConfigManager["ConfigManager\n(config/config.json,\n config.h,\n json.hpp,\n json_fwd.hpp)"]:::config
        ConfigFile[(config.json)]:::storage
    end
    click ConfigManager "https://github.com/pszachary/lockdown-protocol-external/blob/master/config/config.json"
    click ConfigManager "https://github.com/pszachary/lockdown-protocol-external/blob/master/config.h"
    click ConfigManager "https://github.com/pszachary/lockdown-protocol-external/blob/master/nlohmann/json.hpp"
    click ConfigManager "https://github.com/pszachary/lockdown-protocol-external/blob/master/nlohmann/json_fwd.hpp"

    %% Input Handling
    Keybinds["Keybinds\n(keybinds.hpp)"]:::core
    click Keybinds "https://github.com/pszachary/lockdown-protocol-external/blob/master/keybinds.hpp"

    %% Utilities
    subgraph "Utilities"
        Util["Common Helpers\n(util.hpp,\n common.hpp,\n globals.h,\n macros.hpp)"]:::util
    end
    click Util "https://github.com/pszachary/lockdown-protocol-external/blob/master/util.hpp"
    click Util "https://github.com/pszachary/lockdown-protocol-external/blob/master/common.hpp"

    %% External Dependencies
    subgraph "External Dependencies"
        DX11["DirectX11 Hook\n(moverlay.cpp/.h)"]:::external
        ImGuiLib["Dear ImGui\n(overlay/imgui/*.cpp/.h)"]:::external
    end
    click DX11 "https://github.com/pszachary/lockdown-protocol-external/blob/master/overlay/dx11/moverlay.cpp"
    click DX11 "https://github.com/pszachary/lockdown-protocol-external/blob/master/overlay/dx11/moverlay.h"
    click ImGuiLib "https://github.com/pszachary/lockdown-protocol-external/blob/master/overlay/imgui/imgui.cpp"
    click ImGuiLib "https://github.com/pszachary/lockdown-protocol-external/blob/master/overlay/imgui/imgui.h"
    click ImGuiLib "https://github.com/pszachary/lockdown-protocol-external/blob/master/overlay/imgui/imgui_draw.cpp"
    click ImGuiLib "https://github.com/pszachary/lockdown-protocol-external/blob/master/overlay/imgui/imgui_tables.cpp"
    click ImGuiLib "https://github.com/pszachary/lockdown-protocol-external/blob/master/overlay/imgui/imgui_widgets.cpp"
    click ImGuiLib "https://github.com/pszachary/lockdown-protocol-external/blob/master/overlay/imgui/imgui_impl_dx11.cpp"
    click ImGuiLib "https://github.com/pszachary/lockdown-protocol-external/blob/master/overlay/imgui/imgui_impl_dx11.h"

    %% Relationships
    MainLoop -->|Initializes| ConfigManager
    MainLoop -->|Hooks| DX11
    MainLoop --> InputHandler[/"InputHandler"/]:::core
    InputHandler -->|Reads| Keybinds
    MainLoop -->|Loops Each Frame| MemoryManager
    MemoryManager -->|Reads Game Process| GameDataModels
    MemoryManager -->|Provides Data| DataCache
    DataCache --> FeatureManager[/"FeatureManager"/]:::core
    FeatureManager -->|Executes| ESPRenderer
    FeatureManager -->|Executes| RadarModule
    FeatureManager -->|Executes| PlayerHacks
    FeatureManager -->|Executes| WeaponHacks
    FeatureManager -->|Executes| InventoryHacks
    FeatureManager -->|Executes| AimbotModule
    FeatureManager -->|Toggles via| ImGuiMenu
    FeatureManager -->|Saves/Loads| ConfigManager
    FeatureManager -->|Uses| Util
    ESPRenderer -->|Renders via| ImGuiLib
    ESPRenderer -->|Renders via| DX11
    ImGuiMenu -->|Draws UI| ImGuiLib

    %% Styles
    classDef core fill:#cce5ff,stroke:#004085,color:#004085;
    classDef feature fill:#d4edda,stroke:#155724,color:#155724;
    classDef ui fill:#ffe5b4,stroke:#e69500,color:#e69500;
    classDef config fill:#fff3cd,stroke:#856404,color:#856404;
    classDef util fill:#e2e3e5,stroke:#6c757d,color:#6c757d;
    classDef external fill:#f8f9fa,stroke:#343a40,color:#343a40;
    classDef storage fill:#f1f1f1,stroke:#999999,color:#999999;
```
