Overview
The Module serves as the core runtime component that:- Intercepts and modifies game network traffic
- Implements custom multiplayer functionality
- Loads and manages game modifications
- Provides VoIP integration
- Handles game state synchronization
- Enables custom scripting via Lua
Tech Stack
Language
C++17/20
Build System
Bazel with Bazelisk
Compiler
MSVC (Visual Studio)
Architecture
x86-64 DLL injection
Key Dependencies
- EASTL: Custom STL implementation for game compatibility
- gRPC: Communication with KYBER API
- Protocol Buffers: Serialization format
- IXWebSocket: WebSocket client for real-time communication
- Sentry: Crash reporting and error tracking
- Lua: Scripting engine for mods
- Vivox: Voice chat integration
- SafetyHook: Safe function hooking library
- nlohmann/json: JSON parsing
- GLM: Math library for game calculations
Architecture
The Module is organized into distinct subsystems:Core Components
Building
Prerequisites
Install MSYS2
Download and install MSYS2 to
C:\msys64Install Bazelisk
Download Bazelisk and rename to
bazel.exe in your PATHSetup Build Directory
Create a short path for build artifacts to avoid Windows path length limitations:
Build Commands
- Release Build (Required)
- Using Build Script
Module/bazel-bin/Kyber.dllInstalling Built Module
Copy the built DLL to the KYBER installation directory:Build Configuration
Development Setup
Code Completion with VSCode
Install clangd Extension
Install the clangd extension for VSCode
Key Features
Network Interception
The Module intercepts game network calls and redirects them to KYBER servers:- Hooks Winsock API functions (
send,recv,connect) - Redirects EA backend calls to Maxima (custom backend)
- Routes game traffic through KYBER proxy servers
- Maintains compatibility with original game protocols
Mod Loading
Supports multiple mod formats:- FBMod: Frosty mod format (.fbmod)
- Archive Mods: ZIP files with asset overrides
- Script Mods: Lua scripts for gameplay modifications
VoIP Integration
Integrates Vivox SDK for proximity voice chat:- Positional audio based on player location
- Team-based voice channels
- Mute/unmute controls
- Push-to-talk support
Common Issues
Path Too Long Errors
Path Too Long Errors
Bazel generates very long paths. Use
--output_user_root="C:\bz" to shorten them:Game Crashes on Launch
Game Crashes on Launch
Ensure you’re building with
--config=release. Debug builds use different runtime libraries that cause crashes.Missing Dependencies
Missing Dependencies
Update submodules:
MSVC Not Found
MSVC Not Found
Bazel needs to find MSVC. Set environment variable:
Debugging
Recommended Approach
- Use extensive logging with Sentry
- Add debug prints to
DebugConsole - Use
OutputDebugStringfor Windows debug output - Test in isolated environment first
Logging Example
Performance Considerations
- Module runs in the game’s main thread
- Keep hook functions lightweight and fast
- Use async operations for network calls
- Minimize allocations in hot paths
- Profile with game’s built-in profiler