查找CCSPlayerControllerChangeTeam
tools-only2026-10-27查看 206复制 114
使用 IDA Pro MCP 在 CS2 二进制文件中查找并识别 CCSPlayerController_ChangeTeam 函数。在逆向分析 CS2 server.dll 或 libserver.so 时,通过搜索已知的调试字符串引用并分析交叉引用来定位 ChangeTeam 函数时使用此技能。
📘如何使用这个技能
- 1复制技能内容·点击上方「Copy SKILL.md」复制全部内容,或 Download 下载到本地
- 2打开你的 AI 客户端·支持 Claude Code、Trae、Cursor、ChatGPT、DeepSeek、Kimi 等任意 AI 助手
- 3粘贴为系统提示/知识文件·Claude Code:放入 .claude/skills/ 目录;普通对话:作为首条消息发送并说「请严格按这份技能文档执行」
- 4直接提出你的需求·AI 会按技能定义的工作流、格式和约束来处理,无需再解释背景
💡 提示:技能生效后,每次对话只需一句需求,AI 会按 SKILL.md 的流程执行。
SKILL.md2933 chars
---
name: find-CCSPlayerController_ChangeTeam
description: Find and identify the CCSPlayerController_ChangeTeam function in CS2 binary using IDA Pro MCP. Use this skill when reverse engineering CS2 server.dll or libserver.so to locate the ChangeTeam function by searching for known debug string references and analyzing cross-references.
disable-model-invocation: true
---
# Find CCSPlayerController_ChangeTeam
Locate `CCSPlayerController_ChangeTeam` in CS2 server.dll or libserver.so using IDA Pro MCP tools.
## Method
1. Search for the debug string:
```
mcp__ida-pro-mcp__find_regex pattern="ChangeTeam\(\) CTMDBG"
```
2. Get cross-references to the string:
```
mcp__ida-pro-mcp__xrefs_to addrs="<string_addr>"
```
3. Decompile the referencing function:
```
mcp__ida-pro-mcp__decompile addr="<function_addr>"
```
4. Rename the function:
```
mcp__ida-pro-mcp__rename batch={"func": [{"addr": "<function_addr>", "name": "CCSPlayerController_ChangeTeam"}]}
```
5. Find VTable and Calculate Offset:
**ALWAYS** Use SKILL `/get-vtable-index` to get vtable offset and index for the function.
VTable class name: `CCSPlayerController`
6. Generate and validate unique signature:
**ALWAYS** Use SKILL `/generate-signature-for-function` to generate a robust and unique signature for `CCSPlayerController_ChangeTeam`.
7. Write IDA analysis output as YAML beside the binary:
**ALWAYS** Use SKILL `/write-vfunc-as-yaml` to write the analysis results for `CCSPlayerController_ChangeTeam`.
Required parameters:
- `func_name`: `CCSPlayerController_ChangeTeam`
- `func_addr`: The function address from step 3
- `func_sig`: The validated signature from step 6
VTable parameters (when this is a virtual function):
- `vtable_name`: `CCSPlayerController`
- `vfunc_offset`: The offset from step 5
- `vfunc_index`: The index from step 5
## Signature Pattern
The function contains a debug log call with format string:
```
"%s<%i><%s><%s>" ChangeTeam() CTMDBG , team %d, req team %d willSwitch %d, %.2f
```
## Function Characteristics
- **Parameters**: `(this, team_id)` where `this` is CCSPlayerController pointer, `team_id` is the target team
## Team IDs
- `0`: Unassigned
- `1`: Spectator
- `2`: Terrorist
- `3`: Counter-Terrorist
## VTable Information
- **VTable Name**: `CCSPlayerController::\`vftable'`
- **VTable Mangled Name**: `??_7CCSPlayerController@@6B@`
- **VTable Index**: 102 (0x66) - This can change when game updates.
- **VTable Offset**: 0x330 - This can change when game updates.
* Note that for `libserver.so`, The first 16 bytes of "vftable" are for RTTI. the real vftable = `_ZTV19CCSPlayerController (0x221e390)` + `0x10` = `0x221e3A0`.
## Output YAML Format
The output YAML filename depends on the platform:
- `server.dll` → `CCSPlayerController_ChangeTeam.windows.yaml`
- `libserver.so` → `CCSPlayerController_ChangeTeam.linux.yaml`