# ikhsanprasetyo/dota2cheat architecture

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

- Interactive diagram: https://gitdiagram.com/ikhsanprasetyo/dota2cheat
- Repository: https://github.com/ikhsanprasetyo/dota2cheat

## Overview

##### Main Components
- Injection & Main DLL – The entry point is in the injected DLL (e.g., dllmain.cpp), which loads and initializes the cheat.
- Cheat SDK – The “CheatSDK” folder provides the foundation with core utility classes, global definitions, pattern/signature scanning (SignatureDB, VMTDB), online configuration, and hooking helpers. This component abstracts interfaces and game memory access.
- Modules – Within “Modules” you have several subdirectories (Hacks, UI, Utility, etc.) that implement individual cheat features (for automation, information gathering, convars manipulation, changers like tree or weather, and more). They typically interact with the SDK and hooking subsystems.
- UI System – Under “UI” and “Modules/UI” you have code built with ImGui and DirectX 11 to render cheat menus and overlays. This system is activated by user input (pressing Insert) and interacts with modules to display and control cheat functions.
- SDK for Dota2 Integration – The “SDK” folder provides a mapping of game-engine structures, interfaces, and wrappers around Dota 2 entities and systems.
- Network/Protocol Buffers – The “Dota2Proto” project contains auto-generated source code from .proto files that represent game and network message definitions. It decodes net messages which the cheat might use for additional functionality and data representation.

##### Component Relationships and Data Flows
- The DLL injection mechanism loads the cheat into the Dota 2 process.
- Immediately, the Cheat SDK initializes systems—loading signatures, registering hooks, and setting up global game system interfaces.
- The Hooks capture events (e.g., FrameStageNotify, Present, game event listeners) and pass control to the respective modules.
- Each Module (e.g., AutoAccept, AutoHeal, Maphack, AbilityESP, etc.) uses functions from CheatSDK for reading game data, altering game behavior, or drawing UI elements.
- The UI module communicates with modules to display data, toggle features, and receive user inputs via ImGui.
- The Dota2Proto subsystem handles any network messaging required to understand game state updates or decode in-game messages.
- Finally, configuration (settings, possibly with ConVar spoofing) flows in from global configurations in the CheatSDK and may be updated via UI controls.

##### Architectural Patterns and Design Principles
- Modularity: The heavy use of separate directories (Hooks, Modules, SDK, UI) indicates a modular design where each cheat feature is self-contained but uses a central system for common operations.
- Hooking & Event Handling: A central emphasis on intercepting game functions and events, then routing them to various modules.
- Abstraction and Separation: The SDK provides abstractions over the raw game interfaces. Modules encapsulate self-contained cheat functionality.

##### Elements
- Clear labels for every major component (Injection DLL, Hooks, CheatSDK, Modules – further broken down by Hacks, UI, Utility, etc., SDK for Dota 2 integration, and Protocol Buffer based network messaging).
- The flow from Dota 2 game process → Cheat DLL injection.
- Data/control flows between the SDK, Hooking subsystem, and various Modules.
- Data flow from modules to the UI.
- Communication paths from external libraries (MinHook, ImGui, Protocol Buffers) to their respective integration points.

##### Additional Details
- Special components such as:
- The “CheatSDK/Globals” for global game system management.
- The “CheatSDK/Systems/ModuleManager” which indicates centralized control over feature modules.
- The “Hooks/” folder, which is critical in capturing game events.
- Distinguish between compile-time/build configurations and runtime processes. (The solution’s structure reveals use of Visual Studio solution files and vcpkg configuration that ensures build reproducibility but these are secondary to the runtime architecture.)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Layers
    subgraph "Dota 2 Process Layer"
        DotaProcess["Dota 2 Game Process"]:::process
    end

    subgraph "Cheat Injection Layer"
        Injection["Injection & Main DLL"]:::injection
    end

    subgraph "Cheat DLL Layer"
        subgraph "Core Systems"
            SDK["Cheat SDK"]:::sdk
            Hooks["Hooking Subsystem"]:::hook
            SDKGlobals["Globals (CheatSDK)"]:::sdkDetail
            ModuleManager["ModuleManager (CheatSDK)"]:::sdkDetail
        end

        subgraph "Modules"
            Hacks["Hacks Module"]:::module
            UI_Module["UI Module"]:::module
            Utility["Utility Module"]:::module
        end

        UI["UI System"]:::ui
        DotaSDK["SDK for Dota2 Integration"]:::sdk
        Network["Network/Protocol Buffers"]:::network
    end

    subgraph "External Dependencies"
        MinHook["MinHook"]:::external
        ImGui["ImGui"]:::external
        DirectX["DirectX 11"]:::external
    end

    %% Connections - Vertical Flow
    DotaProcess -->|"DLLInjection"| Injection
    Injection -->|"Initialize"| SDK
    Injection -->|"Initialize"| Hooks
    SDK -->|"Setup"| Hooks
    SDK -->|"Manage"| SDKGlobals
    SDK -->|"Manage"| ModuleManager
    Hooks -->|"Intercept"| Hacks
    Hooks -->|"Intercept"| UI_Module
    Hooks -->|"Intercept"| Utility
    Hacks -->|"Data/Control"| UI
    UI_Module -->|"Data/Control"| UI
    SDK -->|"Support"| Hacks
    SDK -->|"Support"| UI_Module
    SDK -->|"Support"| Utility
    SDK -->|"Interface"| DotaSDK
    DotaSDK -->|"Maps Entities"| Network

    %% External dependencies connections
    MinHook -->|"Hooking"| Hooks
    ImGui -->|"Rendering"| UI
    DirectX -->|"Rendering"| UI

    %% Click Events
    click Injection "https://github.com/ikhsanprasetyo/dota2cheat/blob/main/Dota2Cheat/dllmain.cpp"
    click Hooks "https://github.com/ikhsanprasetyo/dota2cheat/tree/main/Dota2Cheat/Hooks"
    click SDK "https://github.com/ikhsanprasetyo/dota2cheat/tree/main/Dota2Cheat/CheatSDK"
    click Hacks "https://github.com/ikhsanprasetyo/dota2cheat/tree/main/Dota2Cheat/Modules"
    click UI "https://github.com/ikhsanprasetyo/dota2cheat/tree/main/Dota2Cheat/UI"
    click DotaSDK "https://github.com/ikhsanprasetyo/dota2cheat/tree/main/Dota2Cheat/SDK"
    click Network "https://github.com/ikhsanprasetyo/dota2cheat/tree/main/Dota2Proto/src"

    %% Styles
    classDef process fill:#ADD8E6,stroke:#000,stroke-width:2px;
    classDef injection fill:#FFC107,stroke:#000,stroke-width:2px;
    classDef sdk fill:#90EE90,stroke:#000,stroke-width:2px;
    classDef hook fill:#FF8C00,stroke:#000,stroke-width:2px;
    classDef module fill:#DDA0DD,stroke:#000,stroke-width:2px;
    classDef ui fill:#FFB6C1,stroke:#000,stroke-width:2px;
    classDef network fill:#F08080,stroke:#000,stroke-width:2px;
    classDef external fill:#C0C0C0,stroke:#000,stroke-width:2px;
    classDef sdkDetail fill:#98FB98,stroke:#000,stroke-width:1px;
```
