$ show CookiePLMonster/SilentPatch
SilentPatch is a runtime patching system for Grand Theft Auto III, Vice City, and San Andreas that applies bug fixes, stability improvements, and enhancements via DLL injection. The architecture centers around a DirectDraw wrapper (DDraw.dll) that hooks into game processes and loads game-specific patches. Each game has a dedicated module (SilentPatchIII/VC/SA) containing version-specific fixes implemented through pattern scanning and memory hooking. Shared components handle cross-cutting concerns like input, rendering, and configuration. The system reads INI files to toggle features and uses a plugin-like architecture for extensibility (e.g., Special Vehicle Features). It does not alter game files on disk, instead modifying memory addresses at runtime to fix issues like widescreen support, crash bugs, and compatibility problems with other mods.
The LLM identified 4 files worth highlighting for reuse:
Provides a safe, version-aware system for binding to game functions and variables via pattern scanning. Encapsulates complexity of memory address resolution and handles different game executables through compile-time version detection. Demonstrates reusable hooking pattern with minimal external dependencies.
Offers RAII-style wrappers for RenderWare state management and iteration patterns. Simplifies safe temporary state changes and object traversal in the game's rendering engine. Shows reusable resource management technique applicable to any stateful API.
Implements robust string-to-number and string parsing functions with proper error handling. Handles edge cases like whitespace, invalid input, and overflow. Self-contained utility demonstrating reliable input parsing without external dependencies.
Null-terminated string reader for parsing configuration sections from INI-like formats. Provides safe, bounds-checked access to delimited data. Exemplifies reusable configuration parsing pattern with minimal dependencies.