### StAC Server Configuration Example (cfg) Source: https://context7.com/sapphonie/stac-tf2/llms.txt This is an example configuration file for StAC, detailing various settings for cheat detection, logging, and security. It outlines parameters for ban durations, detection thresholds, network limits, and integration options. Defaults are provided for ease of use, prioritizing minimal false positives. ```cfg // Basic ban configuration stac_ban_duration "0" // 0 = permanent ban stac_ban_for_misccheats "1" // Ban for non-usercommand cheats stac_generic_ban_msgs "1" // Use generic ban messages // Detection thresholds (-1 = disabled, 0 = log only, >0 = ban after N detections) stac_max_aimsnap_detections "20" // Aimbot/aimsnap detection limit stac_max_psilent_detections "10" // pSilent/NoRecoil detection limit stac_max_bhop_detections "10" // Bhop cheat detection limit stac_max_fakeang_detections "5" // Fake angle detection limit stac_max_cmdnum_detections "20" // Cmdnum spike detection limit stac_max_tbot_detections "0" // Triggerbot detection (default: log only) // Network/Interp limits stac_min_interp_ms "-1" // Minimum allowed interp (-1 = no limit) stac_max_interp_ms "101" // Maximum allowed interp (recommended: 101) // Turn bind detection stac_max_allowed_turn_secs "-1.0" // Time before kicking for turn binds (-1 = disabled) // Server optimizations stac_optimize_cvars "1" // Enable anti-backtrack/lag patches stac_fixpingmasking_enabled "1" // Fix ping masking and detect ping reducers // Logging and notifications stac_log_to_file "1" // Enable file logging stac_silent "0" // 0=admins+STV, 1=STV only, 2=none, -1=all players stac_verbose_info "0" // Enable verbose console spam // Security features stac_max_connections_from_ip "0" // Max connections per IP (0 = disabled) stac_work_with_sv_cheats "0" // Allow StAC with sv_cheats 1 (NOT RECOMMENDED) // Integration stac_include_demoname_in_banreason "1" // Include demo name in SourceBans // Random check intervals for cvar/netprop validation stac_min_randomcheck_secs "60.000000" stac_max_randomcheck_secs "300.000000" ``` -------------------------------- ### Configure Chat Notifications (SourcePawn) Source: https://context7.com/sapphonie/stac-tf2/llms.txt Controls who can see detection messages in-game. Accepts integer values to define visibility levels, from broadcast to all players to no chat output ever. Also shows example formats for admin and ban announcements. ```sourcepawn stac_silent "0" // 0 = admins with sm_ban + SourceTV // 1 = SourceTV only // 2 = no chat output ever // -1 = broadcast to all players // Admin notification format: // "[StAC] AIMSNAP #15 for Player1 - Delta: 45.2" // Ban announcement format: // "[StAC] Player Player1 was aimbotting. Total aimsnap detections: 20. BANNED from server!" ``` -------------------------------- ### StAC Get Cached Steam Auth Command (sourcepawn) Source: https://context7.com/sapphonie/stac-tf2/llms.txt This SourcePawn command, `sm_stac_getauth `, retrieves and prints StAC's cached authentication information for a specified client. This is useful for verifying the SteamID StAC is using for ban operations against a player. The output details the cached SteamID. ```sourcepawn sm_stac_getauth ``` ```bash # In-game usage sm_stac_getauth Player1 # Output shows the cached SteamID that StAC is using for ban operations ``` -------------------------------- ### StAC Required Dependencies (SourcePawn) Source: https://context7.com/sapphonie/stac-tf2/llms.txt Lists the essential extensions and libraries required for the StAC plugin to function, including optional integrations. Dependencies range from web requests and anti-spoofing to demo recording and RCON hardening. ```sourcepawn // Required extensions (auto-installed in release): #include // Web requests - github.com/KyleSanderson/SteamWorks #include // Prevent SteamID spoofing - builds.limetech.io/?project=connect #include // Demo recording info - github.com/peace-maker/sourcetvmanager #include // RCON hardening - builds.limetech.io/?p=webcon // External includes: #include // Achievement validation #include // Colored chat messages #include // Console colors #include // Config file generation #include // JSON parsing // Optional integrations: #tryinclude // Auto-update support #tryinclude // SourceBans++ integration #tryinclude // Material Admin integration #tryinclude // Discord webhook support ``` -------------------------------- ### StAC Plugin Main File and Includes (SourcePawn) Source: https://context7.com/sapphonie/stac-tf2/llms.txt Defines the main plugin file for StAC and lists all included sub-plugins and header files. It also includes plugin metadata such as version, author, and description. ```sourcepawn // Main plugin file: scripting/stac.sp #include "stac/stac_globals.sp" // Global variables and arrays #include "stac/stac_stocks.sp" // Utility functions #include "stac/stac_cvars.sp" // ConVar initialization #include "stac/stac_commands.sp" // Admin commands #include "stac/stac_mapchange.sp" // Map change handlers #include "stac/stac_onplayerruncmd.sp" // OnPlayerRunCmd detections #include "stac/stac_client.sp" // Client connect/disconnect #include "stac/stac_cvar_checks.sp" // ConVar query callbacks #include "stac/stac_misc_checks.sp" // Netprop and misc checks #include "stac/stac_livefeed.sp" // Debug livefeed system #include "stac/stac_memory.sp" // Memory patching/gamedata #include "stac/jay_backtrack_patch.sp" // J_Tanzanite's backtrack patch // Plugin info: #define PLUGIN_VERSION "6.3.7" public Plugin myinfo = { name = "Steph's AntiCheat [StAC]", author = "https://sappho.io", description = "AntiCheat plugin for TF2", version = PLUGIN_VERSION, url = "https://sappho.io" } ``` -------------------------------- ### CBaseServer ConnectClient Signature Source: https://github.com/sapphonie/stac-tf2/blob/master/gamedata/connect.games.txt Defines the signature for the CBaseServer::ConnectClient function. This includes symbol names for Linux and byte patterns for Windows (32-bit and 64-bit) to identify the function in memory. ```hocon CBaseServer__ConnectClient { library "engine" linux "@_ZN11CBaseServer13ConnectClientER8netadr_siiiiPKcS3_S3_i" linux64 "@_ZN11CBaseServer13ConnectClientER8netadr_siiiiPKcS3_S3_i" windows "\x55\x8B\xEC\x81\xEC\x24\x05\x00\x00\x53\x56\x57\x68\x2A\x2A\x2A\x2A" windows64 "\x48\x89\x5C\x24\x2A\x44\x89\x4C\x24\x2A\x55\x56\x57\x41\x54\x41\x55\x41\x56\x41\x57\x48\x81\xEC\x80\x05\x00\x00" } ``` -------------------------------- ### Virtual Function Signatures for CHLTVDemoRecorder (Linux) Source: https://github.com/sapphonie/stac-tf2/blob/master/gamedata/sourcetvmanager.games.txt Provides Linux-specific signatures for 'CHLTVDemoRecorder::StartRecording' and 'CHLTVDemoRecorder::StopRecording'. These functions are virtual but called directly in the Linux binary, necessitating detours. The signatures are essential for runtime analysis and modification of these recording functions on Linux systems. ```plaintext "CHLTVDemoRecorder::StartRecording" { "library" "engine" "linux" "@_ZN17CHLTVDemoRecorder14StartRecordingEPKcb" } "CHLTVDemoRecorder::StopRecording" { "library" "engine" "linux" "@_ZN17CHLTVDemoRecorder13StopRecordingEv" } ``` -------------------------------- ### CBaseServer RejectConnection Signature Source: https://github.com/sapphonie/stac-tf2/blob/master/gamedata/connect.games.txt Provides the signature for the CBaseServer::RejectConnection function. This includes symbol names for Linux and byte patterns for Windows (32-bit and 64-bit) for memory identification. ```hocon CBaseServer__RejectConnection { library "engine" linux "@_ZN11CBaseServer16RejectConnectionERK8netadr_siPKc" linux64 "@_ZN11CBaseServer16RejectConnectionERK8netadr_siPKc" windows "\x55\x8B\xEC\x81\xEC\x04\x05\x00\x00\x57" windows64 "\x48\x89\x5C\x24\x2A\x48\x89\x6C\x24\x2A\x48\x89\x74\x24\x2A\x57\x48\x81\xEC\x50\x05\x00\x00" } ``` -------------------------------- ### SourceBans/gbans Integration (SourcePawn) Source: https://context7.com/sapphonie/stac-tf2/llms.txt Enables integration with ban management plugins like SourceBans++ and gbans. It includes an option to embed the demo name in the ban reason for better context. ```sourcepawn // Compatible with: // - SourceBans++ (SBPP) // - gbans // - Material Admin // - Default TF2 ban handler // Includes demo name in ban reason: stac_include_demoname_in_banreason "1" // Ban reason format: // "[StAC] Banned for aimsnapping after 20 detections (Demo: auto-20251021-2145-cp_badlands.dem)" ``` -------------------------------- ### SourcePawn Turn Bind Detection Configuration Source: https://context7.com/sapphonie/stac-tf2/llms.txt Detects and handles players using +left/+right turn binds or spin scripts. Configurable to disable, instantly kick, or kick after a set duration of detected bind usage. Sends warnings to players. ```sourcepawn // Triggers on: // - Sustained use of IN_LEFT or IN_RIGHT buttons // - Spin bind patterns stac_max_allowed_turn_secs "-1.0" // -1 = disabled, 0 = instant kick, >0 = kick after N seconds // Kick message: // "[StAC] Usage of turn binds or spin binds is not allowed. Kicked from server" // Warning sent to player: // "[StAC] Turn binds and spin binds are not allowed on this server. If you continue to use them you will be autokicked!" ``` -------------------------------- ### Configure Discord Logging for StAC Source: https://github.com/sapphonie/stac-tf2/blob/master/README.md This configuration snippet shows how to set up Discord logging for the StAC plugin. It requires the zipcore's Discord API plugin and involves editing the discord.cfg file to specify the webhook URL for the 'stac' channel. ```cfg "Discord" { "stac" { "url" "discord webhook url" } } ``` -------------------------------- ### File Logging Configuration (SourcePawn) Source: https://context7.com/sapphonie/stac-tf2/llms.txt Enables verbose file logging for StAC detections and actions. Logs are saved to dated files in the 'stac' directory within the sourcemod logs folder, including details like timestamp, client info, detection type, and action taken. ```sourcepawn stac_log_to_file "1" // Log location: // /tf/addons/sourcemod/logs/stac/stac_[month]_[day]_[year].log // Log format includes: // - Timestamp // - Client name and SteamID // - Detection type // - Detection values/details // - Action taken (log/kick/ban) ``` -------------------------------- ### CBaseServer CheckMasterServerRequestRestart Signature (General) Source: https://github.com/sapphonie/stac-tf2/blob/master/gamedata/connect.games.txt Specifies the signature for CBaseServer::CheckMasterServerRequestRestart, intended for general engine use. It includes symbol names for Linux and byte patterns for Windows. ```hocon CBaseServer__CheckMasterServerRequestRestart { // "%cMasterRequestRestart" library "engine" windows "\x55\x8B\xEC\x83\xEC\x1C\x53\x57\x33\xD2" windows64 "\x4C\x8B\xDC\x49\x89\x5B\x2A\x49\x89\x6B\x2A\x56\x57\x41\x54\x41\x56\x41\x57\x48\x83\xEC\x60\x48\x8B\x05\x2A\x2A\x2A\x2A\x48\x8D\x1D" } ``` -------------------------------- ### SourcePawn Aimsnap Detection Configuration Source: https://context7.com/sapphonie/stac-tf2/llms.txt Configures and logs aimbot detection events. Bans players after a specified number of aimsnap detections. Logs detailed information to admins and STV upon detection and announces bans. ```sourcepawn // Detection triggers on: // - Extreme angle deltas between ticks // - Snap patterns matching known aimbot behavior // - Firing bullets with suspicious angle velocity // Configure threshold stac_max_aimsnap_detections "20" // Ban after 20 detections // When detected, logs to admins/STV: // "[StAC] AIMSNAP #15 for Player1 - Delta: 45.2 degrees" // On ban, announces: // "[StAC] Player Player1 was aimbotting. Total aimsnap detections: 20. BANNED from server!" ``` -------------------------------- ### ProcessAccept Signatures for CSGO (Linux) Source: https://github.com/sapphonie/stac-tf2/blob/master/gamedata/conplex.games.txt Provides the Linux byte signature for the ProcessAccept function specifically within the CSGO game. This is used for dynamic analysis and hooking on Linux platforms. ```bytes \x55\x89\xE5\x83\xEC\x58\x89\x5D\xF4\x8B\x5D\x08\x8D\x45\xE0 ``` -------------------------------- ### StAC Enable Live Feed Debug Mode Command (sourcepawn) Source: https://context7.com/sapphonie/stac-tf2/llms.txt The `sm_stac_livefeed ` command in SourcePawn enables real-time debug information for a specific player, including usercommand data, angles, and network statistics. This output is directed to SourceTV if available, aiding in detailed troubleshooting. It requires the player's name as an argument. ```sourcepawn sm_stac_livefeed ``` ```bash # In-game usage sm_stac_livefeed Player1 ``` -------------------------------- ### HandleFailedRconAuth Signatures for Windows Games Source: https://github.com/sapphonie/stac-tf2/blob/master/gamedata/conplex.games.txt Contains Windows-specific byte signatures for the HandleFailedRconAuth function across various game titles (tf, cstrike, hl2mp, dod, csgo, left4dead2). These are used to detect and handle RCon authentication failures. ```bytes \x55\x8B\xEC\x83\xEC\x14\xF7\x05\x2A\x2A\x2A\x2A\x00\x10\x00\x00 ``` ```bytes \x55\x8B\xEC\x83\xEC\x18\xA1\x2A\x2A\x2A\x2A\x8B\x15\x2A\x2A\x2A\x2A\x53\x56\x57 ``` ```bytes \x55\x8B\xEC\x83\xEC\x18\xA1\x2A\x2A\x2A\x2A\x8B\x15\x2A\x2A\x2A\x2A\x53\x56\x57 ``` ```bytes \x55\x8B\xEC\x83\xEC\x18\xA1\x2A\x2A\x2A\x2A\x8B\x15\x2A\x2A\x2A\x2A\x53\x56\x57 ``` ```bytes \x55\x8B\xEC\x83\xEC\x18\xA1\x2A\x2A\x2A\x2A\x8B\x15\x2A\x2A\x2A\x2A\x53\x56\x57 ``` ```bytes \x55\x8B\xEC\x83\xEC\x10\x8B\x15\x2A\x2A\x2A\x2A\x89\x4D\xFC ``` ```bytes \x55\x8B\xEC\x83\xEC\x10\x53\x56\x8B\xD9\x8B\x43\x2A\x57\x33\xFF ``` -------------------------------- ### CBaseServer CheckMasterServerRequestRestart Signature (TF2 Specific) Source: https://github.com/sapphonie/stac-tf2/blob/master/gamedata/connect.games.txt Provides a TF2-specific signature for CBaseServer::CheckMasterServerRequestRestart, including symbol names for Linux and byte patterns for Windows. This might be used to differentiate from other engine implementations. ```hocon tf { Signatures { CBaseServer__CheckMasterServerRequestRestart { library "engine" // "%cMasterRequestRestart" windows "\x55\x8B\xEC\x83\xEC\x18\x53\x57\x33\xD2\x8B\xF9\x8B\x0D\x2A\x2A\x2A\x2A\x89\x55\xE8\x89\x55\xEC\x89\x55\xF4\x8B\x41\x08" windows64 "\x4C\x8B\xDC\x49\x89\x5B\x10\x49\x89\x6B\x18\x56\x57\x41\x54\x41\x56\x41\x57\x48\x83\xEC\x60\x48\x8B\x05\x2A\x83\x20\x00" } } } ``` -------------------------------- ### IClient Offset Hack for Compatibility Source: https://github.com/sapphonie/stac-tf2/blob/master/gamedata/stac.txt This entry highlights a platform-specific 'hack' for the IClient offset, necessary due to potential complexities like multiple inheritance. It provides differing values for Linux and Windows to ensure correct pointer arithmetic. ```plaintext "Offset_IClient_HACK" { "linux" "4" "windows" "0" } ``` -------------------------------- ### ProcessAccept Signatures for Windows Games Source: https://github.com/sapphonie/stac-tf2/blob/master/gamedata/conplex.games.txt Contains Windows-specific byte signatures for the ProcessAccept function across various game titles (tf, cstrike, hl2mp, dod, csgo, left4dead2). These signatures are used to locate the function in memory. ```bytes \x55\x8B\xEC\x83\xEC\x24\x53\x8B\xD9\x8B\x43\x18 ``` ```bytes \x55\x8B\xEC\x83\xEC\x24\x53\x57\x8D\x45\xF8\xC7\x45\xF8\x10\x00\x00\x00\x50 ``` ```bytes \x55\x8B\xEC\x83\xEC\x24\x53\x56\x8D\x45\xF8\xC7\x45\xF8\x10\x00\x00\x00\x50 ``` ```bytes \x55\x8B\xEC\x83\xEC\x24\x53\x57\x8D\x45\xF8\xC7\x45\xF8\x10\x00\x00\x00\x50 ``` ```bytes \x55\x8B\xEC\x83\xEC\x24\x53\x57\x8D\x45\xF8\xC7\x45\xF8\x10\x00\x00\x00\x50 ``` ```bytes \x55\x8B\xEC\x83\xEC\x24\x53\x56\x57\x8D\x45\xF8\xC7\x45\xF8\x10\x00\x00\x00\x50 ``` ```bytes \x55\x8B\xEC\x83\xEC\x28\xA1\x2A\x2A\x2A\x2A\x33\xC5\x89\x45\xFC\x53\x57\x8B\xF9 ``` -------------------------------- ### Server Protection Settings (SourcePawn) Source: https://context7.com/sapphonie/stac-tf2/llms.txt Configures various server protections against exploits such as invalid characters in chat, admin spoofing, unkickable player exploits, and server crash/lag exploits. It also includes IP connection limiting. ```sourcepawn // Protected against: // - Newlines/invalid characters in chat // - Admin spoofing attempts // - Unkickable player exploits // - Cheat-to-cheat communication // - Unauthorized Steam connections // - Server crash exploits // - Server lag exploits // IP connection limiting: stac_max_connections_from_ip "0" // Enable during bot swarms // Invalid name characters: // Bans for: "\n", "\r", control characters in player names // Invalid chat characters: // Bans for: newlines, control characters in chat messages ``` -------------------------------- ### Steam3 Server Signature Configuration Source: https://github.com/sapphonie/stac-tf2/blob/master/gamedata/connect.games.txt Provides the signature (symbol name or byte pattern) for the Steam3 Server function across different platforms. This is essential for locating the function in memory. ```hocon Signatures { Steam3Server { library "engine" linux "@_Z12Steam3Serverv" linux64 "@_Z12Steam3Serverv" } } ``` -------------------------------- ### SourcePawn Triggerbot Detection Configuration Source: https://context7.com/sapphonie/stac-tf2/llms.txt Detects triggerbots and macro software by analyzing shot timing. Can be configured to log only or ban players after a set number of detections. Does not run if `sv_allow_wait_command` is enabled. ```sourcepawn // Triggers on: // - Inhuman reaction times // - Consistent timing patterns matching macros // - Frame-perfect shooting sequences stac_max_tbot_detections "0" // Default: log only, don't ban // Set to 20+ if you want to permaban macro users // Ban message: // "[StAC] Player Player1 was triggerbotting. Total detections: 20. BANNED from server!" ``` -------------------------------- ### Discord Webhook Logging Configuration (JavaScript/CFG) Source: https://context7.com/sapphonie/stac-tf2/llms.txt Configures StAC to send detection alerts to a specified Discord channel via a webhook. This requires the Discord API plugin and a valid webhook URL in the discord.cfg file. ```javascript // Config: /tf/addons/sourcemod/configs/discord.cfg "Discord" { "stac" { "url" "https://discord.com/api/webhooks/123456789/abcdefghijklmnop" } } // Requires Discord API plugin by zipcore // All detections and bans posted to configured webhook // Includes player name, SteamID, detection type, and ban status ``` -------------------------------- ### Game Engine Support Configuration Source: https://github.com/sapphonie/stac-tf2/blob/master/gamedata/connect.games.txt Defines the game engines supported by the configuration. This section lists common Source Engine variants. ```hocon #default { #supported { engine "dods" engine "css" engine "hl2dm" engine "tf2" } } ``` -------------------------------- ### CSGO Engine Signatures (Windows/Linux) Source: https://github.com/sapphonie/stac-tf2/blob/master/gamedata/sourcetvmanager.games.txt Provides hexadecimal byte signatures for identifying specific functions within the CS:GO engine on Windows and Linux. These signatures are used for dynamic analysis and patching. ```plaintext "host_client" { "library" "engine" // ping(CCommand const&) "Client ping times:\n" "linux" "\x55\x89\xE5\x57\x56\x53\x83\xEC\x1C\x8B\x45\x2A\x83\xB8\x2A\x2A\x2A\x2A\x03" "windows" "\x55\x8B\xEC\x51\x8B\x4D\x08\x83\xB9\x08\x05\x00\x00\x03" } "CHLTVServer::BroadcastEventLocal" { "library" "engine" // _ZN11CHLTVServer19BroadcastEventLocalEP10IGameEventb "linux" "\x55\x89\xE5\x57\x56\x8D\x45\x2A\x53\x83\xEC\x68\xC7\x45\x2A\x2A\x2A\x2A\x2A\x8B\x5D\x2A\x50\x8B\x7D" // "SourceTV broadcast local event: %s\n" "windows" "\x55\x8B\xEC\x83\xEC\x4C\x53\x8B\xD9\xC7\x45\xB4\x2A\x2A\x2A\x2A\x56\x8D" } "CHLTVServer::BroadcastLocalChat" { "library" "engine" // _ZN11CHLTVServer18BroadcastLocalChatEPKcS1_ "linux" "\x55\x89\xE5\x57\x56\x53\x83\xEC\x5C\xA1\x2A\x2A\x2A\x2A\x8B\x7D\x2A\x8B\x00" // "hltv_chat" "windows" "\x55\x8B\xEC\x83\xEC\x54\xA1\x2A\x2A\x2A\x2A\x53" } "CHLTVServer_DemoRecorderRef" { "library" "engine" // _ZN11CHLTVServer26StopRecordingAndFreeFramesEbPK9CGameInfo "linux" "\x55\x89\xE5\x57\x56\x53\x83\xEC\x3C\x8B\x75\x2A\x8B\x5D\x2A\x88\x5D" // _ZN11CHLTVServer11IsRecordingEv "windows" "\x8B\x81\x2A\x2A\x2A\x2A\x81\xC1\x2A\x2A\x2A\x2A\x8B\x40\x2A\xFF\xE0" } // StartRecording and StopRecording are virtual, but get called directly in the linux binary.. // Need to add a detour. "CHLTVDemoRecorder::StartRecording" { "library" "engine" // "StartRecording: couldn't open demo file %s.\n" // _ZN17CHLTVDemoRecorder14StartRecordingEPKcb "linux" "\x55\x89\xE5\x57\x56\x53\x81\xEC\x24\x01\x00\x00\x8B\x5D\x08\x65\xA1\x14\x00\x00\x00" } "CHLTVDemoRecorder::StopRecording" { "library" "engine" // "Completed GOTV demo \"%s\", recording time %.1f\n" // _ZN17CHLTVDemoRecorder13StopRecordingEPK9CGameInfo "linux" "\x55\x89\xE5\x8B\x45\x08\x80\xB8\x40\x05\x00\x00\x00" } ``` -------------------------------- ### HandleFailedRconAuth Signatures for CSGO (Linux) Source: https://github.com/sapphonie/stac-tf2/blob/master/gamedata/conplex.games.txt Provides the Linux byte signature for the HandleFailedRconAuth function within the CSGO game. This is essential for detecting and managing RCon authentication failures on Linux. ```bytes \x55\xB8\x2A\x2A\x2A\x2A\x89\xE5\x57\x56\x53\x83\xEC\x5C\x8B\x15\x2A\x2A\x2A\x2A\x8B ``` -------------------------------- ### CSGO Engine Addresses and Offsets (Windows/Linux) Source: https://github.com/sapphonie/stac-tf2/blob/master/gamedata/sourcetvmanager.games.txt Defines memory addresses and offsets for game functions and variables within the CS:GO engine, specifying values for both Windows and Linux environments. These are crucial for locating specific game data and code. ```plaintext "host_client" { "windows" { "signature" "host_client" "read" "26" } "linux" { "signature" "host_client" "read" "49" } } "CHLTVServer::m_DemoRecorder" { "windows" { "signature" "CHLTVServer_DemoRecorderRef" "read" "2" } "linux" { "signature" "CHLTVServer_DemoRecorderRef" "read" "42" } } "CBaseServer::BroadcastPrintf" { "windows" "39" "linux" "40" } "CHLTVServer::ConnectClient" { "windows" "54" "linux" "55" } "CHLTVServer::RejectConnection" { "windows" "52" "linux" "53" } "CHLTVServer::GetChallengeType" { "windows" "59" "linux" "60" } "CBaseClient::ActivatePlayer" { "windows" "28" "linux" "66" } "CBaseClient::FireGameEvent" { "windows" "1" "linux" "2" } "CBaseClient::Disconnect" { "linux" "16" } "CHLTVServer::Shutdown" { "windows" "45" "linux" "46" } "CHLTVDirector::m_iPVSEntity" { "windows" "32" "linux" "32" } "CHLTVDirector::m_vPVSOrigin" { "windows" "36" "linux" "36" } "CHLTVDirector::m_nNextShotTick" { "windows" "52" "linux" "52" } // This gets subtracted from the offset looked up by the "CHLTVServer::m_DemoRecorder" address "CHLTVDemoRecorder_BaseOffset" { "windows" "0" "linux" "4" } ``` -------------------------------- ### Function Signatures for Engine Library (Windows/Linux) Source: https://github.com/sapphonie/stac-tf2/blob/master/gamedata/sourcetvmanager.games.txt Contains function signatures (byte patterns) for various functions within the 'engine' library, used for locating these functions in memory. Signatures are provided for both Windows and Linux, often including both a symbolic name for Linux and a hexadecimal byte sequence for Windows. These are critical for hooking or analyzing game functions. ```plaintext "host_client" { "library" "engine" "linux" "@host_client" "windows" "\x55\x8B\xEC\x51\x83\x3D\x2A\x2A\x2A\x2A\x01\x75\x2A" } "CHLTVServer::BroadcastEventLocal" { "library" "engine" "linux" "@_ZN11CHLTVServer19BroadcastEventLocalEP10IGameEventb" "windows" "\x55\x8B\xEC\x81\xEC\xA4\x04\x00\x00\xA1\x2A\x2A\x2A\x2A\x33\xC5\x89\x45\xFC\xD9\xEE" } "CHLTVServer::BroadcastLocalChat" { "library" "engine" "linux" "@_ZN11CHLTVServer18BroadcastLocalChatEPKcS1_" "windows" "\x55\x8B\xEC\x81\xEC\xA8\x04\x00\x00\xA1\x2A\x2A\x2A\x2A\x33\xC5\x89\x45\xFC\x8B\x45\x0C" } "CHLTVServer::Shutdown" { "library" "engine" "linux" "@_ZN11CHLTVServer8ShutdownEv" "windows" "\x56\x8B\xF1\x8B\x86\x2A\x2A\x2A\x2A\x8B\x50\x2A\x8D\x8E\x2A\x2A\x2A\x2A\xFF\xD2\x8B\x86\x2A\x2A\x2A\x2A\x8B\x50\x2A\x8D\x8E" } ``` -------------------------------- ### RunFrame Signatures for CSGO (Linux) Source: https://github.com/sapphonie/stac-tf2/blob/master/gamedata/conplex.games.txt Provides the Linux byte signature for the RunFrame function specifically within the CSGO game. This signature is used to locate and hook the function on Linux systems. ```bytes \x55\x89\xE5\x57\x56\x53\x81\xEC\x6C\x10\x00\x00\x8B\x75\x08\x83\xC6\x04 ``` -------------------------------- ### Convar Checking Configuration (SourcePawn) Source: https://context7.com/sapphonie/stac-tf2/llms.txt Configures the checking of client convars to detect cheat-related values and out-of-bounds settings. It defines variables to track, their required values, and settings for check frequency and banning. ```sourcepawn // Checked variables include: char miscVars[][] { "sensitivity", // Tracked for analysis "sv_cheats", // Must be 0 "cl_interpolate", // Must be 1 "fov_desired", // Checked for bounds "cl_cmdrate", // Must be >= 10 "r_drawothermodels", // Must be 1 "snd_show", // Must be 0 "snd_visualize", // Must be 0 "cl_thirdperson", // Must be 0 "r_portalsopenall", // Must be 0 "host_timescale", // Must be 1.0 "mat_wireframe", // Must be 0 "mat_fillrate", // Must be 0 "r_drawparticles", // Must be 1 "net_blockmsg", // Must be 0 "net_droppackets", // Must be 0 "net_fakejitter", // Must be 0 "net_fakelag", // Must be 0 "net_fakeloss", // Must be 0 "r_skybox", // Must be 1 "r_drawskybox", // Must be 1 "cl_pitchup", // Must be 89 "cl_pitchdown" // Must be 89 }; // Known cheat-specific cvars: char cheatVars[][] { "rijin_load", // Rijin cheat "setcvar", // Generic cheat command "cat_load", // Cathook "crash", // fware "windows_speaker_config", // Cathook spoof "getcvar" // Amalgam cheat }; // Configure check frequency: stac_min_randomcheck_secs "60" // Check at least every 60 seconds stac_max_randomcheck_secs "300" // Check at most every 300 seconds // Ban for violations: stac_ban_for_misccheats "1" // Enable banning for cvar violations ``` -------------------------------- ### OrangeBox Valve Engine Addresses and Offsets (Windows/Linux) Source: https://github.com/sapphonie/stac-tf2/blob/master/gamedata/sourcetvmanager.games.txt Configuration for the OrangeBox Valve engine, detailing memory addresses and offsets for game functions. This section provides specific values for Windows and Linux. ```plaintext "host_client" { "windows" { "signature" "host_client" "read" "92" } "linux" { "signature" "host_client" } } "CHLTVServer::m_DemoRecorder" { "windows" { "signature" "CHLTVServer::Shutdown" "read" "5" } "linux" { "signature" "CHLTVServer::Shutdown" "read" "12" } } "CNetChan::SendNetMsg" { "windows" "40" "linux" "41" } "CBaseClient::m_NetChannel" { "windows" "192" "linux" "196" } "CGameClient::ClientPrintf" { "linux" "24" } "CBaseServer::BroadcastPrintf" { "windows" "35" "linux" "36" } "CHLTVServer::ConnectClient" { "windows" "49" "linux" "50" } "CHLTVServer::RejectConnection" { "windows" "47" "linux" "48" } "CHLTVServer::GetChallengeType" { "windows" "54" "linux" "55" } "CBaseClient::ActivatePlayer" { "windows" "16" "linux" "56" } "CBaseClient::FireGameEvent" { "windows" "1" "linux" "2" } "CBaseClient::Disconnect" { "linux" "14" } "CBaseClient::ExecuteStringCommand" { "linux" "22" } ``` -------------------------------- ### StAC Force Check All Client Convars Command (sourcepawn) Source: https://context7.com/sapphonie/stac-tf2/llms.txt This SourcePawn command, `sm_stac_checkall`, forces an immediate convar check on all connected clients. It requires the `sm_ban` permission to execute and is useful for on-demand security audits. The command logs its action to the console. ```sourcepawn sm_stac_checkall ``` ```bash # In-game usage sm_stac_checkall # Console output example [StAC] Checking cvars on all clients. ``` -------------------------------- ### StAC Show All Current Detections Command (sourcepawn) Source: https://context7.com/sapphonie/stac-tf2/llms.txt The `sm_stac_detections` command in SourcePawn displays the current detection counts for all players on the server. This command helps administrators monitor ongoing cheat detection activities for each player. The output is formatted for readability. ```sourcepawn sm_stac_detections ``` ```bash # In-game usage sm_stac_detections # Example output in console [StAC] === Printing current detections === Detections for Player1 - Turn binds - 0 FakeAngs - 0 Aimsnaps - 15 pSilent - 0 Cmdnum spikes - 0 Possible triggerbot detects - 0 Invalid Usercmds -0 Attempts to see if StAC is running - 0 [StAC] === Done === ``` -------------------------------- ### CBaseClient::GetPlayerSlot Offset Source: https://github.com/sapphonie/stac-tf2/blob/master/gamedata/stac.txt Retrieves the 'GetPlayerSlot' function offset within the CBaseClient class. The comment indicates a complex determination process involving string cross-references and virtual call analysis, with platform-specific values for Linux and Windows. ```plaintext "CBaseClient::GetPlayerSlot" { "linux" "15" // annoying offset to get that i'm just trusting nosoop to be correct on (it doesn't crash): // "find SV_BroadcastVoiceData via string xref "Sending voice from: %s - playerslot: %d" // virtual calls made prior to that (call dword ptr [eax+38h] on windows, buncha machinery comparing to _ZThn4_NK11CBaseClient13GetPlayerSlotEv on linux)" "windows" "14" } ``` -------------------------------- ### CHLTVDirector Memory Offsets (Windows/Linux) Source: https://github.com/sapphonie/stac-tf2/blob/master/gamedata/sourcetvmanager.games.txt Provides memory offsets for CHLTVDirector class members, specifically 'm_iPVSEntity', 'm_vPVSOrigin', and 'm_nNextShotTick'. These offsets are crucial for directly accessing and manipulating director-related data within the game server. The offsets are platform-dependent, with distinct values for Windows and Linux. ```plaintext "CHLTVDirector::m_iPVSEntity" { "windows" "32" "linux" "32" } "CHLTVDirector::m_vPVSOrigin" { "windows" "36" "linux" "36" } "CHLTVDirector::m_nNextShotTick" { "windows" "56" "linux" "56" } ``` -------------------------------- ### CBasePlayer::ProcessUsercmds API Source: https://github.com/sapphonie/stac-tf2/blob/master/gamedata/stac.txt Processes user commands for a CBasePlayer entity. It handles command input, number of commands, and some unknown parameters. ```APIDOC ## CBasePlayer::ProcessUsercmds API ### Description Processes user input commands for a player entity. ### Method (Not specified, likely internal C++ function) ### Endpoint (Not applicable, internal function) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **ucmd** (objectptr) - Pointer to the user command object. - **numcmds** (int) - The number of commands being processed. - **totalcmds** (int) - The total number of commands available. - **unk_int** (int) - An unknown integer parameter. - **unk_bool** (bool) - An unknown boolean parameter. ### Request Example (Not applicable) ### Response #### Success Response (void) This function returns void. #### Response Example (Not applicable) ### Signatures - **Linux:** `_ZN11CBasePlayer15ProcessUsercmdsEP8CUserCmdiiib` - **Windows:** `\x55\x8B\xEC\x83\xEC\x10\x53\x8B\xD9\x56\x57\xFF\xB3\xCC\x0C\x00\x00` - **Library:** `server` ``` -------------------------------- ### Interp/Lerp Enforcement (SourcePawn) Source: https://context7.com/sapphonie/stac-tf2/llms.txt Enforces interpolation limits to prevent lerp abuse by configuring the minimum and maximum allowed interpolation values in milliseconds. Violators receive a kick message detailing the bounds. ```sourcepawn // Configure allowed interp range (in milliseconds) stac_min_interp_ms "-1" // -1 to disable minimum stac_max_interp_ms "101" // Maximum allowed interp // Kick message sent to violators: // "[StAC] Your interp (150.5ms) was out of bounds! Minimum allowed: -1ms. Maximum allowed: 101ms. Please fix this before rejoining" // Announcement: // "[StAC] Player Player1's interp was 150.5ms, indicating interp exploitation. Kicked from server." ``` -------------------------------- ### CHLTVDemoRecorder Base Offset (Windows/Linux) Source: https://github.com/sapphonie/stac-tf2/blob/master/gamedata/sourcetvmanager.games.txt Defines the base memory offset for CHLTVDemoRecorder. This offset is fundamental for calculating the addresses of other members or functions within the CHLTVDemoRecorder class. It includes platform-specific values for Windows and Linux. ```plaintext "CHLTVDemoRecorder_BaseOffset" { "windows" "0" "linux" "4" } ``` -------------------------------- ### SourcePawn Cmdnum Spike Detection Configuration Source: https://context7.com/sapphonie/stac-tf2/llms.txt Detects cmdnum manipulation, often used for clientside nospread and sequence breaking. Bans players after a threshold of detected spikes. ```sourcepawn // Triggers on: // - Abnormal cmdnum jumps/spikes // - Cmdnum values inconsistent with normal gameplay // - Used by lmaobox nospread and nullcore sequence breaking stac_max_cmdnum_detections "20" // Ban after 20 spikes // Ban message: // "[StAC] Player Player1 had too many cmdnum spikes, indicating cheating. Total detections: 20. BANNED from server!" ``` -------------------------------- ### SourcePawn Bhop Detection Configuration Source: https://context7.com/sapphonie/stac-tf2/llms.txt Detects auto-bhop cheats through a two-stage system involving consecutive perfect hops and reduced gravity. Bans players after a set number of detections. ```sourcepawn // Two-stage detection system: // 1. Client triggers detection on consecutive perfect bhops // 2. Gravity set to 8x as "antibhop" measure // 3. If client continues perfect bhops on 8x gravity, ban stac_max_bhop_detections "10" // Sets antibhop at 10, bans at 12 // Ban message: // "[StAC] Player Player1 was bhopping using a cheat program. Total consecutive bhops: 12. BANNED from server!" ``` -------------------------------- ### SourcePawn pSilent/NoRecoil Detection Configuration Source: https://context7.com/sapphonie/stac-tf2/llms.txt Detects silent aim and no-recoil cheats by comparing player view angles with actual firing angles. Bans players after reaching a configured detection threshold. ```sourcepawn // Detection triggers on: // - Mismatch between viewangles and bullet trajectory // - Recoil compensation patterns matching known cheats stac_max_psilent_detections "10" // Ban after 10 detections // Ban message example: // "[StAC] Player Player1 was using pSilentAim or NoRecoil. Total detections: 10. BANNED from server!" ``` -------------------------------- ### SignonState Offset Determination Source: https://github.com/sapphonie/stac-tf2/blob/master/gamedata/stac.txt This snippet shows how the 'SignonState' offset is determined, with platform-specific values for Linux and Windows. The offset is crucial for accessing the signon state information of the game client. ```assembly bool __thiscall sub_1007F080(_DWORD *this) { ; vvvv * 4 = 0xC4 return this[0x31] >= 2; } ``` -------------------------------- ### Engine Function Signatures for ProcessAccept (Linux) Source: https://github.com/sapphonie/stac-tf2/blob/master/gamedata/conplex.games.txt Provides the Linux assembly signature for the ProcessAccept function within the engine library. This signature is crucial for identifying and hooking the function dynamically in Linux environments. ```assembly _ZN14CSocketCreator13ProcessAcceptEv ``` -------------------------------- ### StAC Discord Webhook Configuration (json) Source: https://context7.com/sapphonie/stac-tf2/llms.txt This JSON snippet configures StAC to send ban notifications and logs to a Discord webhook. It requires the webhook URL to be set in the `discord.cfg` file. Ensure the provided URL is correct for your Discord channel. ```json "Discord" { "stac" { "url" "https://discord.com/api/webhooks/YOUR_WEBHOOK_ID/YOUR_WEBHOOK_TOKEN" } } ``` -------------------------------- ### Engine Function Signatures for HandleFailedRconAuth (Linux) Source: https://github.com/sapphonie/stac-tf2/blob/master/gamedata/conplex.games.txt Provides the Linux assembly signature for the HandleFailedRconAuth function within the engine library. This is used to identify and potentially modify the handling of RCon authentication failures on Linux systems. ```assembly _ZN11CRConServer20HandleFailedRconAuthERK8netadr_s ``` -------------------------------- ### Steam Game Server Function Offsets Source: https://github.com/sapphonie/stac-tf2/blob/master/gamedata/connect.games.txt Specifies memory offsets for critical Steam Game Server functions across different operating systems. These offsets are crucial for game server modding and anti-cheat detection. ```hocon Offsets { ISteamGameServer__BeginAuthSession { linux "26" linux64 "26" windows "26" windows64 "26" } ISteamGameServer__EndAuthSession { linux "27" linux64 "27" windows "27" windows64 "27" } CheckMasterServerRequestRestart_Steam3ServerFuncOffset { windows "240" windows64 "299" } } ``` -------------------------------- ### Engine Function Signatures for RunFrame (Linux) Source: https://github.com/sapphonie/stac-tf2/blob/master/gamedata/conplex.games.txt Provides the Linux assembly signature for the RunFrame function within the engine library. This signature is used for dynamic analysis and modification of the RCon server's frame processing on Linux. ```assembly _ZN11CRConServer8RunFrameEv ``` -------------------------------- ### CNetChan::GetMsgHandler Offset Source: https://github.com/sapphonie/stac-tf2/blob/master/gamedata/stac.txt Details the memory offset for the 'GetMsgHandler' function in the CNetChan class. The offset differs slightly between Linux and Windows environments. ```plaintext "CNetChan::GetMsgHandler" { "linux" "47" "windows" "46" } ```