# quantumloader/ohd-internal architecture

> Architecture diagram of the GitHub repository quantumloader/ohd-internal, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-02-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/quantumloader/ohd-internal
- Repository: https://github.com/quantumloader/ohd-internal

## Overview

##### Project Type & Purpose
- Clearly denote that this is an injected cheat DLL built for modifying the game’s behavior.
- That its purpose is to provide enhancements for in-game information display (ESP), aim assistance, exploit injection (e.g., speed hacks), and miscellaneous UI tweaks.
- Mention that it leverages direct function hooking (via MinHook) and an overlaying UI using ImGui.

##### Analyzing the File Structure
- The top-level “Internal” folder contains the core source code, project files (Internal.vcxproj), and the main entry point (dllmain.cpp).
- Directories and files like Cheat.h, Hook.h, and esp_lib.h indicate modules responsible for managing cheat logic and hooking.
- The “Internal/ImGui” directory is included to provide the overlay UI, including associated source files (imgui.cpp, imgui_draw.cpp, etc.).
- The “Internal/MinHook” directory provides the requisite hooking functionalities.
- The “Internal/SDK” directory contains headers and other auxiliary files that represent game structures, ensuring that the cheat can interact with in-game objects.

##### Defining Main Components
- Injector/Entry Point:
– Represent the entry point (dllmain.cpp) that starts the cheat as soon as it’s injected.
- Hooking Manager:
– Label a component for managing code hooks. This uses MinHook to intercept game functions.
– Show links to “Hook.h” and associated MinHook source files.
- UI / Overlay Module:
– Include components like the ImGui core and its DirectX/Win32 implementation files (imgui_impl_dx11.cpp/h, imgui_impl_win32.cpp/h).
- Cheat Feature Modules:
– Divide these into the four categories (Visuals, Aim, Exploits, and Misc) as modular components.
– These modules use the hooking manager’s callbacks to intercept game logic, process data using game SDK headers, and then display cheat information.
- SDK Layer:
– Represent a support layer that provides access to the game’s internal data structures, as seen in the “Internal/SDK” folder.
– Indicate that this layer enables a safe interface between the cheat functions and game objects.

##### Relationships and Interactions
- Hooking Manager to both the UI/Overlay Module and the Cheat Feature Modules:
– Data (such as game object states) moves from game engine functions (hooked by MinHook) to cheat modules.
– The UI module then renders visual feedback (for Visuals and Misc features) based on the data processed by those modules.
- The SDK layer interfaces with both the cheat features and the hooking system, providing necessary in-game object definitions.

##### Highlighting Architectural Patterns
- Hooking/Injection Pattern:
– The cheat DLL is injected externally (using a separate injector), and then hooks game functions dynamically.
- Overlay Rendering Pattern:
– The use of ImGui for drawing an in-game overlay is a core component that operates concurrently with the hooked game functions.
- Separation of Concerns:
– The project is structured to clearly separate low-level hooking (using MinHook) from high-level cheat features and UI rendering.

## Diagram (Mermaid)

```mermaid
flowchart TD
    A["Injector/Entry Point"]:::entry
    B["Hook Manager (MinHook)"]:::hook
    C["UI/Overlay Module (ImGui)"]:::ui
    subgraph "Cheat Feature Modules"
        D["Visuals (ESP)"]:::cheat
        E["Core Cheat Logic"]:::cheat
    end
    F["Game SDK Interface"]:::sdk

    A -->|"initializes"| B
    B -->|"hooks"| C
    B -->|"injects-callbacks"| D
    B -->|"injects-callbacks"| E
    D -->|"sends-display-data"| C
    E -->|"sends-data"| C
    F -->|"provides-data"| D
    F -->|"provides-data"| E
    F -->|"interfaces"| B

    click A "https://github.com/quantumloader/ohd-internal/blob/master/Internal/dllmain.cpp"
    click B "https://github.com/quantumloader/ohd-internal/blob/master/Internal/Hook.h"
    click B "https://github.com/quantumloader/ohd-internal/tree/master/Internal/MinHook"
    click C "https://github.com/quantumloader/ohd-internal/tree/master/Internal/ImGui"
    click D "https://github.com/quantumloader/ohd-internal/blob/master/Internal/esp_lib.h"
    click E "https://github.com/quantumloader/ohd-internal/blob/master/Internal/Cheat.h"
    click E "https://github.com/quantumloader/ohd-internal/blob/master/Internal/Menu.h"
    click F "https://github.com/quantumloader/ohd-internal/tree/master/Internal/SDK"

    classDef entry fill:#fbb,stroke:#333,stroke-width:2px;
    classDef hook fill:#faa,stroke:#333,stroke-width:2px;
    classDef ui fill:#bbf,stroke:#333,stroke-width:2px;
    classDef cheat fill:#bfb,stroke:#333,stroke-width:2px;
    classDef sdk fill:#d9a,stroke:#333,stroke-width:2px;
```
