Find CBaseEntity_TakeDamageOld
Locate CBaseEntity_TakeDamageOld in CS2 server.dll or server.so using IDA Pro MCP tools.
Method
Search for the debug string:
mcp__ida-pro-mcp__find_regex pattern="TakeDamageOld.*GetDamageForce"Or alternatively:
mcp__ida-pro-mcp__find_regex pattern="TakeDamageOld.*GetDamagePosition"Get cross-references to the string:
mcp__ida-pro-mcp__xrefs_to addrs="<string_addr>"Decompile the referencing function and verify it matches:
mcp__ida-pro-mcp__decompile addr="<function_addr>"The target function should contain:
- DevWarning calls with these strings:
"CBaseEntity::TakeDamageOld: damagetype %d with info.GetDamageForce() == Vector::vZero\n""CBaseEntity::TakeDamageOld: damagetype %d with info.GetDamagePosition() == Vector::vZero\n"
- Checks for zero vectors in damage force and position
- Complex damage handling logic with multiple condition checks
Example pattern:
if ( (*(float *)(a2 + 8) == 0.0 && *(float *)(a2 + 12) == 0.0 && *(float *)(a2 + 16) == 0.0 || *(float *)(a2 + 20) == 0.0 && *(float *)(a2 + 24) == 0.0 && *(float *)(a2 + 28) == 0.0) && ++dword_XXXXXXXX < 10 ) { if ( *(float *)(a2 + 8) == 0.0 && ... ) DevWarning("CBaseEntity::TakeDamageOld: damagetype %d with info.GetDamageForce() == Vector::vZero\n", ...); if ( *(float *)(a2 + 20) == 0.0 && ... ) DevWarning("CBaseEntity::TakeDamageOld: damagetype %d with info.GetDamagePosition() == Vector::vZero\n", ...); }- DevWarning calls with these strings:
Rename the function:
mcp__ida-pro-mcp__rename batch={"func": [{"addr": "<function_addr>", "name": "CBaseEntity_TakeDamageOld"}]}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:CBaseEntity_TakeDamageOldfunc_addr: The function address from step 3func_sig: The validated signature from step 5
Function Characteristics
- Prototype:
unsigned __int64 CBaseEntity_TakeDamageOld(void *pEntity, CTakeDamageInfo *info, void *a3) - Parameters:
pEntity: Pointer to the entity taking damageinfo: Pointer to CTakeDamageInfo structure containing damage detailsa3: Additional parameter (damage output info)
- Return: unsigned __int64
Key Behaviors
- Validates damage info (force vector, position vector)
- Logs debug warnings when damage vectors are zero (limited to 10 times)
- Processes damage through entity's damage handling system
- Large function (~0x675 bytes) with extensive damage processing logic
DLL Information
- DLL:
server.dll(Windows) /server.so(Linux)
Notes
- This is a core damage handling function
- Contains debug validation for damage info integrity
- The zero vector checks help identify improperly initialized damage info
Output YAML Format
The output YAML filename depends on the platform:
server.dll→CBaseEntity_TakeDamageOld.windows.yamlserver.so→CBaseEntity_TakeDamageOld.linux.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.