How rei-2/amalgam works
Project type and purpose
• Amalgam is a native C++ “game-cheat” DLL designed to be injected into a Windows game process (Team Fortress 2) via a VAC bypass or Xenos injector.
• Its purpose is to hook into the game’s engine functions, read or modify game data, and render overlays (ESP, Aimbot, Visuals) using ImGui and FreeType.
File structure
• Top-level solution (Amalgam.sln) builds one DLL project (Amalgam.vcxproj).
• “include/” brings in third-party libraries:
• ImGui (UI rendering)
• MinHook (runtime function hooking)
• FreeType (font rasterization)
• “src/” is subdivided into:
• Core (initialization, module loader)
• DllMain (entry point)
• Hooks (one file per engine function hook)
• SDK (game engine definitions & interfaces)
• Features (Aimbot, Visuals, Networking, etc.)
• Utils (common helpers: memory scanning, hooking glue, timers, crash logging)
• BytePatches (patching bytes in memory)
• Configuration and build scripts under “.github/” and “packages.config.”
README for insights
• Describes downloadable artifacts (AVX2, FreeType variants).
• Mentions dependencies (VAC bypass, Xenos).
• Confirms primary use-case: injected DLL cheat with UI overlay.
Main components & their relationships
a. External Injector
• Runs outside the game, loads the Amalgam DLL into the target process.
b. Core Module
• DllMain initializes the system, reads configs, sets up MinHook.
• Orchestrates the order: apply byte patches, install hooks, initialize UI.
c. Hooking Layer
• Uses MinHook to detour game engine functions (found in “src/Hooks”).
• All engine calls funnel through these hooks before/after original logic.
d. SDK Interfaces
• C++ wrappers around game engine classes and functions.
• Hooks invoke SDK to read game state (players, world, commands).
e. Feature Modules
• Organized under “src/Features” (Aimbot, Visuals, Backtrack, etc.).
• Subscribe to hook callbacks, inspect/modify game data, issue game commands.
f. UI Layer
• ImGui + FreeType provide a menu overlay drawn on top of the game scene.
• Features register menus, controls, font assets under “src/Features/ImGui.”
g. Utility Modules
• Helpers for memory operations, signature scanning, convars, crash reporting.
• Invoked by Core and Features to simplify low-level tasks.
Architectural patterns & design principles
• Layered architecture: Injector → Core → Hooking → SDK → Features → UI.
• Modular plugin pattern: each Feature is isolated in its own folder, implements a common interface.
• Dependency inversion: Features depend on SDK interfaces, not on engine internals directly.
• Single responsibility: Core only handles bootstrap; each module has one focus (hooks vs visuals vs input).
• Layer separation: group “Hooks,” “SDK,” “Features,” “UI,” and “Utils” inside the “Amalgam DLL” boundary.
• From Game Engine into Hooks (detour) → back to Game Engine
• From Features down to SDK → Engine state
• From Core to Hooks & Features (initialization)
• From UI to rendering libraries → GPU/framebuffer