A deep dive into building a cross-game mod menu using C++ and ImGui, covering memory management, game hooking, and rendering.
For over four years, I worked on Cheat-Menu, a mod menu supporting Grand Theft Auto III, Vice City, and San Andreas. This project taught me more about systems programming, memory management, and real-time rendering than any coursework ever could.
The menu is built as an ASI plugin — a DLL that gets loaded by the game engine at startup. The core architecture follows a modular pattern:
class CheatMenu {
private:
std::unordered_map<std::string, Category*> categories;
public:
void Initialize() {
RegisterCategory("Player", new PlayerCategory());
RegisterCategory("Vehicle", new VehicleCategory());
RegisterCategory("World", new WorldCategory());
}
void Render() {
ImGui::Begin("Cheat Menu");
for (auto& [name, category] : categories) {
if (ImGui::TreeNode(name.c_str())) {
category->Render();
ImGui::TreePop();
}
}
ImGui::End();
}
};
Each category is self-contained, managing its own state and rendering logic. This made it easy to add new features without touching the core system.
The most challenging aspect was hooking into game functions without causing crashes. I used a detour-based approach:
The pattern scanning approach works across different game versions since the actual addresses change between patches:
uintptr_t FindPattern(const char* module, const char* pattern) {
auto* base = GetModuleHandleA(module);
// Scan through memory looking for the byte pattern
// ...
return address;
}