Skip to content
Back to skills

215 Name Skill Fe70b9f2

ASecurity

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.

  • 9 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added October 11, 2026
data

Works with

  • mcp

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned October 11, 2026

npx -y skills add tools-only/X-Skills --skill 215-name-skill_fe70b9f2 --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of 215 Name Skill Fe70b9f2?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for 215 Name Skill Fe70b9f2
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/tools-only-215-name-skill-fe70b9f2/badge)](https://www.skillsdirectory.com/skills/tools-only-215-name-skill-fe70b9f2)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
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

1. Search for the debug string:
   ```
   mcp__ida-pro-mcp__find_regex pattern="SwitchTeam => ChangeBasePlayerTeamAndPendingTeam"
   ```

2. Get cross-references to the string:
   ```
   mcp__ida-pro-mcp__xrefs_to addrs="<string_addr>"
   ```

3. 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>"
   ```

4. 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

5. Decompile the wrapper function:
   ```
   mcp__ida-pro-mcp__decompile addr="<wrapper_function_addr>"
   ```

6. Rename the function:
   ```
   mcp__ida-pro-mcp__rename batch={"func": [{"addr": "<wrapper_function_addr>", "name": "CCSPlayerController_SwitchTeam"}]}
   ```

7. Generate and validate unique signature:

   **ALWAYS** Use SKILL `/generate-signature-for-function` to generate a robust and unique signature for the function.

8. 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)` where `this` is CCSPlayerController pointer, `team_id` is 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

```c
__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`: Unassigned
- `1`: Spectator
- `2`: Terrorist
- `3`: 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`

```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.
```

Files in this skill

  • README.md914 B
  • skill.md3.7 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.