How stevenklar/age-of-empires-ii-2013 works
Project type and purpose
• This is a native C++ “game‐hack” DLL that injects into the Age of Empires II (2013) process.
• Its goal is to hook into the game’s functions (via DetourHook), read memory structures (Offsets, Classes), and overlay debugging/ESP/map‑hack information through ImGui + DirectX9.
File structure
• Top‐level solution and project files: AoE_IMGUI.sln, AoE_IMGUI.vcxproj ⇒ MSVC C++ DLL project.
• AoE_IMGUI/ directory contains all core C++ code:
• Core.cpp/.h and dllmain.cpp – entry point and module initialization.
• DetourHook.* – wrapper around Microsoft Detours for function hooking.
• Engine.*, FeatureManager.*, Feature.* – abstraction layers for feature registration and update loops.
• Maphack.*, ResourceInformation.*, UnitCollisions.* – individual feature modules.
• Renderer.* – rendering logic, bridges memory data into ImGui calls.
• Offsets.h, Classes.h, Sdk.h – memory layouts and signature definitions.
• ImGui/ directory: the entire Dear ImGui library with Win32 + DirectX9 back ends.
• README.md describes features (ESP, resource display, maphack, extensibility).
Key insights from README
• Hooks into game to read player resources, unit counts, fog‑of‑war data.
• Uses pattern scanning + reverse‑engineered offsets.
• Extensible by adding new “Feature” modules.
• Relies on DirectX9 overlay via ImGui.
a. Main components to include
• External System: Age of Empires II (2013) Game Process
• Injection Layer: dllmain → DetourHook Module
• Memory Access Layer: Offsets & Classes definitions + pattern scanning
• Core Engine: Core/Engine classes that schedule “tick” updates
• Feature Manager: FeatureManager registers and updates Feature modules
• Feature Modules: Maphack, ResourceInformation, UnitCollisions, ESP, etc.
• Rendering Layer: Renderer module + ImGui back ends (Win32 + Dx9)
• ImGui Library: UI widgets and internal renderer
b. Relationships and interactions
• dllmain loads on process attach → initializes DetourHook
• DetourHook hooks target game functions (e.g., main loop, rendering)
• On each frame or game tick, Core triggers Engine → FeatureManager → each Feature
• Features read game memory via Offsets/Classes, possibly call hooked game functions
• ImGui core renders UI overlays on top of the game window
c. Architectural patterns/design principles
• Modular plugin pattern: each Feature is self‑contained, registered at runtime
• Hook‐and‐proxy pattern: DetourHook intercepts game functions without modifying original binary
• Layered architecture: clear separation between memory access, business logic (features), and presentation (UI)
d. Key technologies/frameworks
• Microsoft Detours (for hooking)
• Dear ImGui (for overlay UI) with DirectX9 + Win32 back ends
• C++17 (or similar) project in MSVC
• Pattern scanning for dynamic offset resolution
Detail without over‑splitting
• Third‑party or OS components (Detours, DirectX9, Win32 API) to show external dependencies.
• Module’s role is clear: data source, controller, renderer, or external dependency.