查找CGameRules客户端设置变更
tools-only2026-10-26查看 1261复制 1728
使用 IDA Pro MCP 在 CS2 二进制文件中查找并识别 CGameRules_ClientSettingsChanged 函数。在逆向工程 CS2 server.dll 或 server.so 以通过搜索 "fov_desired" 字符串引用并分析交叉引用来定位 ClientSettingsChanged 函数时使用此技能。
📘如何使用这个技能
- 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.md3842 chars
---
name: find-CGameRules_ClientSettingsChanged
description: Find and identify the CGameRules_ClientSettingsChanged function in CS2 binary using IDA Pro MCP. Use this skill when reverse engineering CS2 server.dll or server.so to locate the ClientSettingsChanged function by searching for the "fov_desired" string reference and analyzing cross-references.
---
# Find CGameRules_ClientSettingsChanged
Locate `CGameRules::ClientSettingsChanged` in CS2 server.dll or server.so using IDA Pro MCP tools.
## Method
1. Search for the string:
```
mcp__ida-pro-mcp__find_regex pattern="fov_desired"
```
2. Get cross-references to the string:
```
mcp__ida-pro-mcp__xrefs_to addrs="<string_addr>"
```
3. Decompile the referencing functions and look for this pattern:
```
mcp__ida-pro-mcp__decompile addr="<function_addr>"
```
The target function should contain code similar to:
```cpp
if ( (_DWORD)PlayerInfo != -1 )
v4 = (_DWORD)PlayerInfo - 1;
v31 = (_BYTE *)v30(g_Source2EngineToServer, v4, "fov_desired");
v23 = v22;
if ( v22 && *v22 && (unsigned int)V_atoi(v22) )
```
You should also see references to `oldname`, `newname` and `player_changename` within the function.
4. Rename the function:
```
mcp__ida-pro-mcp__rename batch={"func": [{"addr": "<function_addr>", "name": "CGameRules_ClientSettingsChanged"}]}
```
5. Find VTable and Calculate Offset:
**ALWAYS** Use SKILL `/get-vftable-index` to get vtable offset and index for the function.
6. Generate and validate unique signature:
**ALWAYS** Use SKILL `/generate-signature-for-function` to generate a robust and unique signature for the function.
7. Write IDA analysis output as YAML beside the binary:
**ALWAYS** Use SKILL `/write-vfunc-ida-analysis-output-as-yaml` to write the analysis results.
Required parameters:
- `func_name`: `CGameRules_ClientSettingsChanged`
- `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`: `CGameRules` or `CCSGameRules` (depending on which vtable contains it)
- `vfunc_offset`: The offset from step 5
- `vfunc_index`: The index from step 5
## Signature Pattern
The function contains a call to get the `fov_desired` convar value:
```cpp
v31 = (_BYTE *)v30(g_Source2EngineToServer, v4, "fov_desired");
```
And contains string references related to player name changes:
- `oldname`
- `newname`
- `player_changename`
## Function Characteristics
- **Prototype**: `bool CGameRules::ClientSettingsChanged(CGameRules *pGameRules, CBasePlayerController *pPlayerController)`
- **Parameters**:
- `pGameRules`: Pointer to the CGameRules instance (this)
- `pPlayerController`: Pointer to the player controller whose settings changed
- **Return**: `bool` indicating success/failure
## DLL Information
- **DLL**: `server.dll` (Windows) / `server.so` (Linux)
## Output YAML Format
The output YAML filename depends on the platform:
- `server.dll` → `CGameRules_ClientSettingsChanged.windows.yaml`
- `server.so` → `CGameRules_ClientSettingsChanged.linux.yaml`
```yaml
func_va: 0x180XXXXXX # Virtual address of the function - This can change when game updates.
func_rva: 0xXXXXXX # Relative virtual address (VA - image base) - This can change when game updates.
func_size: 0xXXX # 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.
vtable_name: CGameRules # (if virtual function)
vfunc_offset: 0xXXX # Offset from vtable start - This can change when game updates. (if virtual function)
vfunc_index: XX # vtable[XX] - This can change when game updates. (if virtual function)
```