Use when adding new error messages to React, or seeing "unknown error code" warnings.
npx skills add hzqst/CS2_VibeSignatures --skill "find-CCSPlayerController_SwitchTeam"
Install specific skill from multi-skill repository
# Description
Find and identify the CCSPlayerController_SwitchTeam function in CS2 binary using IDA Pro MCP. Use this skill when reverse engineering CS2 server.dll or server.so to locate the SwitchTeam function by searching for known debug string references and analyzing cross-references.
# SKILL.md
name: find-CCSPlayerController_SwitchTeam
description: Find and identify the CCSPlayerController_SwitchTeam function in CS2 binary using IDA Pro MCP. Use this skill when reverse engineering CS2 server.dll or server.so to locate the SwitchTeam function by searching for known debug string references and analyzing cross-references.
Find CCSPlayerController_SwitchTeam
Locate CCSPlayerController_SwitchTeam in CS2 server.dll or server.so using IDA Pro MCP tools.
Method
-
Search for the debug string:
mcp__ida-pro-mcp__find_regex pattern="SwitchTeam => ChangeBasePlayerTeamAndPendingTeam" -
Get cross-references to the string:
mcp__ida-pro-mcp__xrefs_to addrs="<string_addr>" -
The string is referenced in an internal function. Get cross-references to that function to find the public wrapper:
mcp__ida-pro-mcp__xrefs_to addrs="<internal_function_addr>" -
Look for a small wrapper function (~0x5d bytes) that:
- Validates team index (checks if team is 2 or 3)
- Prints error if invalid:
"CCSPlayerPawnBase::SwitchTeam( %d ) - invalid team index.\n" -
Calls the internal function if team is valid and different from current team
-
Decompile the wrapper function:
mcp__ida-pro-mcp__decompile addr="<wrapper_function_addr>" -
Rename the function:
mcp__ida-pro-mcp__rename batch={"func": [{"addr": "<wrapper_function_addr>", "name": "CCSPlayerController_SwitchTeam"}]} -
Generate and validate unique signature:
DO NOT use find_bytes as it won't work for function.
ALWAYS Use SKILL /generate-signature-for-function to generate a robust and unique signature for the function.
- Write IDA analysis output as YAML beside the binary:
ALWAYS Use SKILL /write-func-as-yaml to write the analysis results.
Required parameters:
- func_name: CCSPlayerController_SwitchTeam
- func_addr: The function address from step 5
- func_sig: The validated signature from step 7
Note: This is NOT a virtual function, so no vtable parameters are needed.
Signature Pattern
The function references two debug strings:
1. Internal function: "%s<%i><%s><%s>" SwitchTeam => ChangeBasePlayerTeamAndPendingTeam =%d , req team %d %.2f \n
2. Wrapper function: "CCSPlayerPawnBase::SwitchTeam( %d ) - invalid team index.\n"
Function Characteristics
- Parameters:
(this, team_id)wherethisis CCSPlayerController pointer,team_idis the target team - Validation: Checks if team_id is 2 (Terrorist) or 3 (Counter-Terrorist)
- Behavior: Only calls internal switch if new team differs from current team (offset 0x624)
Function Structure
__int64 CCSPlayerController_SwitchTeam(__int64 this, unsigned int team_id)
{
if ( !ValidateTeam(team_id) || team_id - 2 > 1 )
return PrintError("CCSPlayerPawnBase::SwitchTeam( %d ) - invalid team index.\n", team_id);
current_team = *(unsigned __int8 *)(this + 0x624); // m_iTeamNum offset
if ( team_id != current_team )
return CCSPlayerController_SwitchTeam_Internal(this, team_id);
return current_team;
}
Team IDs
0: Unassigned1: Spectator2: Terrorist3: Counter-Terrorist
Output YAML Format
The output YAML filename depends on the platform:
- server.dll → CCSPlayerController_SwitchTeam.windows.yaml
- server.so → CCSPlayerController_SwitchTeam.linux.yaml
func_va: 0x137A0A0 # Virtual address of the function - This can change when game updates.
func_rva: 0x137A0A0 # Relative virtual address (VA - image base) - This can change when game updates.
func_size: 0x5d # Function size in bytes - This can change when game updates.
func_sig: XX XX XX XX XX # Unique byte signature for pattern scanning - This can change when game updates.
# Supported AI Coding Agents
This skill is compatible with the SKILL.md standard and works with all major AI coding agents:
Learn more about the SKILL.md standard and how to use these skills with your preferred AI coding agent.