$ show emp0ry/cs2-ErScripts
ErScripts is a Windows desktop application written in C++ that serves as an external toolkit for Counter-Strike 2. It enhances gameplay by providing an overlay (bomb timer, crosshairs, keystrokes) and automation features (auto-accept, anti-AFK, jump throws). It operates without memory injection, instead relying on CS2's Game State Integration (GSI) HTTP server, console log file monitoring, and simulated keystrokes to inject commands via CS2's exec system. The architecture is a monolithic Win32 application using Dear ImGui for its overlay rendering (DX11/Win32 backend) and a local HTTP server (cpp-httplib) for game state ingestion. Features are implemented as separate modules (e.g., AutoAccept.cpp, BombTime.cpp) that run in their own threads, reading from a global state object and a JSON configuration file. The project demonstrates a strong understanding of Windows system programming, game state integration patterns, and immediate-mode GUI development. While functionally impressive, the codebase exhibits significant technical debt and security risks. Patterns like UI Access token duplication (UIAccess.c), polymorphic binary rebuilding (Rebuild.cpp), and window class spoofing are fragile and raise security concerns. The project is tightly coupled to CS2's specific internals, making it highly susceptible to breakage from game updates. Despite this, several components (FileMonitor, GradientManager, SteamTools, Logger) are well-encapsulated and demonstrate reusable patterns suitable for extraction into other Windows utility projects. The project is actively maintained but carries medium technical drift due to its reliance on specific game APIs and vendored dependencies.
The LLM identified 5 files worth highlighting for reuse:
A generic, thread-safe file tailer that monitors a file for changes and provides new lines via a mutex-protected deque. It is self-contained (only depends on standard library and Logger) and can be extracted into any project requiring log file or real-time file change monitoring.
A self-contained HSV to RGB gradient generator that runs in its own thread, providing a continuously updating color value. It is completely decoupled from the rest of the application and can be reused in any project needing animated color transitions, such as LED controllers, visualizers, or UI themes.
A simple, self-contained logging utility with support for narrow and wide string overloads and ANSI color codes for console output. It follows a standard singleton/utility pattern and can be dropped into any C++ project for structured logging.
A utility for playing WAV audio files using the Windows MCI (Media Control Interface). It handles writing embedded binary sound data to temporary files and playing them, with a fallback to custom file paths. The pattern of extracting and playing embedded resources is reusable for notification sounds or UI audio cues.
A utility module for parsing Steam configuration files (VDF format) and Windows Registry keys to discover Steam installation paths, active users, and game-specific launch options. It encapsulates the complex logic of navigating Steam's configuration structure, making it highly reusable for any tool that needs to integrate with Steam or locate Steam games.