Find CBasePlayerController_SetPlayerName
Locate CBasePlayerController_SetPlayerName in CS2 server.dll or server.so using IDA Pro MCP tools.
Method
Search for strings
fov_desiredandnewname:mcp__ida-pro-mcp__find_regex pattern="fov_desired" mcp__ida-pro-mcp__find_regex pattern="newname"Get cross-references to both strings:
mcp__ida-pro-mcp__xrefs_to addrs=["<fov_desired_addr>", "<newname_addr>"]Find the function that references both strings - this is the player info sync function.
Decompile that function and look for the call to
CBasePlayerController_SetPlayerName:mcp__ida-pro-mcp__decompile addr="<function_addr>"In the decompiled output, find the pattern:
CBasePlayerController_SetPlayerName(a2, v6); // after name comparison and event firingRename if needed:
mcp__ida-pro-mcp__rename batch={"func": [{"addr": "<target_addr>", "name": "CBasePlayerController_SetPlayerName"}]}Get function details for YAML:
mcp__ida-pro-mcp__lookup_funcs queries="<target_addr>"Generate and validate unique signature:
ALWAYS Use SKILL
/generate-signature-for-functionto generate a robust and unique signature for the function.Write IDA analysis output as YAML beside the binary:
ALWAYS Use SKILL
/write-func-as-yamlto write the analysis results.Required parameters:
func_name:CBasePlayerController_SetPlayerNamefunc_addr: The function address from step 7func_sig: The validated signature from step 8
Note: This is NOT a virtual function, so no vtable parameters are needed.
Signature Pattern
The function is called after:
- Creating
CMsgPlayerInfomessage - Firing
player_changenameevent withuserid,oldname,newnamefields - Comparing old and new player names
The surrounding function also handles fov_desired cvar (clamps FOV between 1-135).
Function Characteristics
- Type: Regular member function (NOT virtual)
- Parameters:
(CBasePlayerController* this, const char* name) - Behavior:
- Copies player name to
this + 0x510usingV_strncpywith max length 128 - Calls network state change notification
- Copies player name to
Hex Signature
| Bytes | Instruction | Description |
|---|---|---|
41 B8 80 00 00 00 |
mov r8d, 80h |
128 byte max name length (unique) |
48 8D 99 10 05 00 00 |
lea rbx, [rcx+510h] |
Name storage offset 0x510 (unique) |
Final signature: 41 B8 80 00 00 00 48 8D 99 10 05 00 00
Output YAML Format
The output YAML filename depends on the platform:
server.dll→CBasePlayerController_SetPlayerName.windows.yamlserver.so→CBasePlayerController_SetPlayerName.linux.yaml
func_va: 0x180A8CA10 # Virtual address of the function - This can change when game updates.
func_rva: 0xA8CA10 # Relative virtual address (VA - image base) - This can change when game updates.
func_size: 0x3F # Function size in bytes - This can change when game updates.
func_sig: 41 B8 80 00 00 00 48 8D 99 10 05 00 00 # Unique byte signature for pattern scanning.
Note: This is NOT a virtual function, so there are no vfunc_* fields.