Find CBaseModelEntity_SetModel
Locate CBaseModelEntity_SetModel in CS2 server.dll or server.so using IDA Pro MCP tools.
Method
Search for a known model path string:
mcp__ida-pro-mcp__find_regex pattern="weapons/models/defuser/defuser\.vmdl"- You should ALWAYS use single back-slash here instead of double back-slash(which means you should go with escaped dot).
Get cross-references to the string:
mcp__ida-pro-mcp__xrefs_to addrs="<string_addr>"Decompile the referencing functions to identify which one calls SetModel:
mcp__ida-pro-mcp__decompile addr="<function_addr>"Look for a function that takes
(this, model_path)as parameters and is called early in entity initialization.Identify the SetModel function from the decompiled code. It will be called like:
sub_XXXXXX(a1, "weapons/models/defuser/defuser.vmdl");The first argument is the entity pointer, second is the model path.
Get function info:
mcp__ida-pro-mcp__lookup_funcs queries="<setmodel_func_addr>"Rename the function:
mcp__ida-pro-mcp__rename batch={"func": {"addr": "<function_addr>", "name": "CBaseModelEntity_SetModel"}}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:CBaseModelEntity_SetModelfunc_addr: The function address from step 5func_sig: The validated signature from step 7
Signature Pattern
The function is called with a model path string as the second parameter:
CBaseModelEntity_SetModel(entity_ptr, "path/to/model.vmdl");
Common model paths that reference this function:
weapons/models/defuser/defuser.vmdl- Other
.vmdlmodel paths in entity spawn/initialization code
Function Characteristics
- Parameters:
(this, model_path)wherethisis CBaseModelEntity pointer,model_pathis the VMDL model path string - Purpose: Sets the visual model for an entity
- Called by: Entity spawn functions, item drop functions, weapon equip functions
Output YAML Format
The output YAML filename depends on the platform:
server.dll→CBaseModelEntity_SetModel.windows.yamlserver.so→CBaseModelEntity_SetModel.linux.yaml
func_va: 0x142de40 # Virtual address of the function - This can change when game updates.
func_rva: 0x142de40 # Relative virtual address (VA - image base) - This can change when game updates.
func_size: 0x3d # 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.