$ show TeamREPENTOGON/REPENTOGON
REPENTOGON is a comprehensive modding framework for the game The Binding of Isaac: Repentance. It extends the game's Lua API with hundreds of new functions, provides low-level hooking and assembly patching capabilities, integrates ImGui for developer tools, and adds features like custom item pools, save syncing, virtual room management, and achievement tracking. The architecture is a hybrid of a C++ DLL that injects into the game process and a set of Lua scripts that run in the game's Lua environment. Key entry points include the DLL main (dllmain.cpp) which initializes hooks and patches, and the Lua registration system (LuaInit.cpp) which exposes new classes and callbacks. The framework relies on reverse-engineered game structures, signature scanning, and runtime code modification to achieve deep integration. External dependencies include the game itself, Lua 5.4, ImGui, and several bundled libraries (glad, rapidxml, rapidjson, mINI). The codebase is large and actively maintained, with a strong focus on modder extensibility and bug fixing.
The LLM identified 5 files worth highlighting for reuse:
Provides a generic function hooking infrastructure using detours and trampolines. Supports multiple calling conventions (thiscall, stdcall, fastcall) and automatic argument forwarding. The HOOK_METHOD and HOOK_STATIC macros allow clean declaration of hooks with minimal boilerplate. This component is self-contained within libzhl and could be extracted for use in other Windows game modding projects.
Implements a fluent builder pattern for constructing and applying inline assembly patches at runtime. Supports register save/restore, relative jumps, calls, and arbitrary byte sequences. The ASMPatch class allows building patches declaratively, and the ASMPatcher applies them to target addresses. This is a reusable low-level utility for runtime code modification, independent of the game's specific structures.
Provides foundational Lua binding utilities used throughout the project. Includes RegisterNewClass for creating Lua userdata metatables, RegisterFunction for adding methods, LuaStackProtector for RAII stack balance checking, and LuaCaller for type-safe Lua function invocation. These patterns are generic and could be reused in any C++ project that needs to expose classes to Lua.
Defines a generic binary save file abstraction with chunk-based structure, checksum validation, and read/write operations. The SaveFile class handles file I/O, checksum computation, and chunk iteration. It is designed for the game's save format but the pattern (header, chunks, checksums) is reusable for any binary save system requiring integrity verification.
Implements a tree-based UI element system that can be constructed and manipulated from Lua. Elements (windows, menus, tabs, inputs) have children, callbacks, and data storage. The DrawElements function recursively renders the tree using ImGui. This pattern decouples UI structure from rendering logic and is reusable for any project that wants to expose a dynamic UI to a scripting language.