Find CCSGameRules_TerminateRound and CEntityInstance_AcceptInput
Locate CCSGameRules_TerminateRound and CEntityInstance_AcceptInput 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="TerminateRound"
Expected matches:
TerminateRound - Plain string reference
TerminateRound: unknown round end ID %i\n - Error message
Get cross-references to the plain string TerminateRound:
mcp__ida-pro-mcp__xrefs_to addrs="<string_addr>"
Decompile the referencing function to verify:
mcp__ida-pro-mcp__decompile addr="<function_addr>"
Rename the function:
mcp__ida-pro-mcp__rename batch={"func": [{"addr": "<function_addr>", "name": "CCSGameRules_TerminateRound"}]}
In the decompiled code of CCSGameRules_TerminateRound, look for calls with "CTsWin" or "TerroristsWin" string parameters:
if ( v11 == 1 )
{
v28 = 0;
if ( dword_181D5DB68 > 0 )
{
v29 = 0LL;
do
{
sub_XXXXXXX(*(_QWORD *)(v29 + qword_181D5DB70), (__int64)"CTsWin", 0, 0, (__int64)&v123, 0, 0LL); // <-- CEntityInstance_AcceptInput
++v28;
v29 += 8LL;
}
while ( v28 < dword_181D5DB68 );
}
}
else if ( v11 == 2 )
{
v30 = 0;
if ( dword_181D5DB68 > 0 )
{
v31 = 0LL;
do
{
sub_XXXXXXX(*(_QWORD *)(v31 + qword_181D5DB70), (__int64)"TerroristsWin", 0, 0, (__int64)&v123, 0, 0LL); // <-- CEntityInstance_AcceptInput
++v30;
v31 += 8LL;
}
while ( v30 < dword_181D5DB68 );
}
}
The function being called with "CTsWin" or "TerroristsWin" is CEntityInstance_AcceptInput.
Rename CEntityInstance_AcceptInput:
mcp__ida-pro-mcp__rename batch={"func": [{"addr": "<acceptinput_func_addr>", "name": "CEntityInstance_AcceptInput"}]}
Generate and validate unique signature for CCSGameRules_TerminateRound:
ALWAYS Use SKILL /generate-signature-for-function to generate a robust and unique signature for the function.
Write IDA analysis output for CCSGameRules_TerminateRound as YAML beside the binary:
ALWAYS Use SKILL /write-func-as-yaml to write the analysis results.
Required parameters:
func_name: CCSGameRules_TerminateRound
func_addr: The function address from step 3
func_sig: The validated signature from step 7
Note: This is NOT a virtual function, so no vtable parameters are needed.
Generate and validate unique signature for CEntityInstance_AcceptInput:
ALWAYS Use SKILL /generate-signature-for-function to generate a robust and unique signature for the function.
Write IDA analysis output for CEntityInstance_AcceptInput as YAML beside the binary:
ALWAYS Use SKILL /write-func-as-yaml to write the analysis results.
Required parameters:
func_name: CEntityInstance_AcceptInput
func_addr: The function address of CEntityInstance_AcceptInput from step 5
func_sig: The validated signature from step 9
Note: This is NOT a virtual function, so no vtable parameters are needed.
Function Characteristics
CCSGameRules_TerminateRound
- Purpose: Terminates the current round with a specified reason and delay
- Prototype:
void CCSGameRules_TerminateRound(CCSGameRules* this, float delay, int reason, ...)
- Parameters:
this - CCSGameRules pointer
delay (xmm1) - Float delay before round ends
reason (r8d) - Round end reason ID
- Additional parameters for legacy support
CEntityInstance_AcceptInput
- Purpose: Handles entity input events (like "CTsWin", "TerroristsWin")
- Prototype:
void CEntityInstance_AcceptInput(CEntityInstance* this, const char* inputName, int param1, int param2, variant_t* value, int param4, void* reserved)
- Parameters:
this - CEntityInstance pointer
inputName - Name of the input event (e.g., "CTsWin", "TerroristsWin")
param1 - Additional parameter (usually 0)
param2 - Additional parameter (usually 0)
value - Variant value pointer
param4 - Additional parameter (usually 0)
reserved - Reserved parameter (usually NULL)
Round End Reason IDs
Common values (may vary by game version):
1: CTs win (triggers "CTsWin" input)
2: Terrorists win (triggers "TerroristsWin" input)
0: Target bombed
3: Terrorists escaped
4: CTs prevented escape
5: Escaping terrorists neutralized
6: Bomb defused
7: CTs win (alternative)
8: Terrorists win (alternative)
9: Round draw
10: All hostages rescued
11: Target saved
12: Hostages not rescued
13: Terrorists not escaped
14: VIP not escaped
15: Game commencing
16: Terrorists surrender
17: CTs surrender
DLL Information
- DLL:
server.dll (Windows) / server.so (Linux)
Notes
- Both functions are regular functions, NOT virtual functions
CEntityInstance_AcceptInput is called within CCSGameRules_TerminateRound to notify entities about round results
- The "CTsWin" input is sent when reason == 1 (CTs win)
- The "TerroristsWin" input is sent when reason == 2 (Terrorists win)
Output YAML Format
The output YAML filename depends on the platform:
server.dll -> CCSGameRules_TerminateRound.windows.yaml, CEntityInstance_AcceptInput.windows.yaml
server.so -> CCSGameRules_TerminateRound.linux.yaml, CEntityInstance_AcceptInput.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.
1---2name: find-ccsgamerules-terminateround-and-centityinstance-accepti3description: Find and identify the CCSGameRules_TerminateRound and CEntityInstance_AcceptInput functions in CS2 binary using IDA Pro MCP. Use this skill when reverse engineering CS2 server.dll or server.so to locate the TerminateRound function by searching for the "TerminateRound" string reference and then identifying CEntityInstance_AcceptInput by analyzing calls with "CTsWin" or "TerroristsWin" string parameters.4---56# Find CCSGameRules_TerminateRound and CEntityInstance_AcceptInput78Locate `CCSGameRules_TerminateRound` and `CEntityInstance_AcceptInput` in CS2 `server.dll` or `server.so` using IDA Pro MCP tools.910## Method11121. Search for the debug string:13 ```14 mcp__ida-pro-mcp__find_regex pattern="TerminateRound"15 ```1617 Expected matches:18 - `TerminateRound` - Plain string reference19 - `TerminateRound: unknown round end ID %i\n` - Error message20212. Get cross-references to the plain string `TerminateRound`:22 ```23 mcp__ida-pro-mcp__xrefs_to addrs="<string_addr>"24 ```25263. Decompile the referencing function to verify:27 ```28 mcp__ida-pro-mcp__decompile addr="<function_addr>"29 ```30314. Rename the function:32 ```33 mcp__ida-pro-mcp__rename batch={"func": [{"addr": "<function_addr>", "name": "CCSGameRules_TerminateRound"}]}34 ```35365. In the decompiled code of `CCSGameRules_TerminateRound`, look for calls with "CTsWin" or "TerroristsWin" string parameters:37 ```c38 if ( v11 == 1 )39 {40 v28 = 0;41 if ( dword_181D5DB68 > 0 )42 {43 v29 = 0LL;44 do45 {46 sub_XXXXXXX(*(_QWORD *)(v29 + qword_181D5DB70), (__int64)"CTsWin", 0, 0, (__int64)&v123, 0, 0LL); // <-- CEntityInstance_AcceptInput47 ++v28;48 v29 += 8LL;49 }50 while ( v28 < dword_181D5DB68 );51 }52 }53 else if ( v11 == 2 )54 {55 v30 = 0;56 if ( dword_181D5DB68 > 0 )57 {58 v31 = 0LL;59 do60 {61 sub_XXXXXXX(*(_QWORD *)(v31 + qword_181D5DB70), (__int64)"TerroristsWin", 0, 0, (__int64)&v123, 0, 0LL); // <-- CEntityInstance_AcceptInput62 ++v30;63 v31 += 8LL;64 }65 while ( v30 < dword_181D5DB68 );66 }67 }68 ```6970 The function being called with "CTsWin" or "TerroristsWin" is `CEntityInstance_AcceptInput`.71726. Rename `CEntityInstance_AcceptInput`:73 ```74 mcp__ida-pro-mcp__rename batch={"func": [{"addr": "<acceptinput_func_addr>", "name": "CEntityInstance_AcceptInput"}]}75 ```76777. Generate and validate unique signature for `CCSGameRules_TerminateRound`:7879 **ALWAYS** Use SKILL `/generate-signature-for-function` to generate a robust and unique signature for the function.80818. Write IDA analysis output for `CCSGameRules_TerminateRound` as YAML beside the binary:8283 **ALWAYS** Use SKILL `/write-func-as-yaml` to write the analysis results.8485 Required parameters:86 - `func_name`: `CCSGameRules_TerminateRound`87 - `func_addr`: The function address from step 388 - `func_sig`: The validated signature from step 78990 Note: This is NOT a virtual function, so no vtable parameters are needed.91929. Generate and validate unique signature for `CEntityInstance_AcceptInput`:9394 **ALWAYS** Use SKILL `/generate-signature-for-function` to generate a robust and unique signature for the function.959610. Write IDA analysis output for `CEntityInstance_AcceptInput` as YAML beside the binary:9798 **ALWAYS** Use SKILL `/write-func-as-yaml` to write the analysis results.99100 Required parameters:101 - `func_name`: `CEntityInstance_AcceptInput`102 - `func_addr`: The function address of `CEntityInstance_AcceptInput` from step 5103 - `func_sig`: The validated signature from step 9104105 Note: This is NOT a virtual function, so no vtable parameters are needed.106107## Function Characteristics108109### CCSGameRules_TerminateRound110111- **Purpose**: Terminates the current round with a specified reason and delay112- **Prototype**: `void CCSGameRules_TerminateRound(CCSGameRules* this, float delay, int reason, ...)`113- **Parameters**:114 - `this` - CCSGameRules pointer115 - `delay` (xmm1) - Float delay before round ends116 - `reason` (r8d) - Round end reason ID117 - Additional parameters for legacy support118119### CEntityInstance_AcceptInput120121- **Purpose**: Handles entity input events (like "CTsWin", "TerroristsWin")122- **Prototype**: `void CEntityInstance_AcceptInput(CEntityInstance* this, const char* inputName, int param1, int param2, variant_t* value, int param4, void* reserved)`123- **Parameters**:124 - `this` - CEntityInstance pointer125 - `inputName` - Name of the input event (e.g., "CTsWin", "TerroristsWin")126 - `param1` - Additional parameter (usually 0)127 - `param2` - Additional parameter (usually 0)128 - `value` - Variant value pointer129 - `param4` - Additional parameter (usually 0)130 - `reserved` - Reserved parameter (usually NULL)131132## Round End Reason IDs133134Common values (may vary by game version):135- `1`: CTs win (triggers "CTsWin" input)136- `2`: Terrorists win (triggers "TerroristsWin" input)137- `0`: Target bombed138- `3`: Terrorists escaped139- `4`: CTs prevented escape140- `5`: Escaping terrorists neutralized141- `6`: Bomb defused142- `7`: CTs win (alternative)143- `8`: Terrorists win (alternative)144- `9`: Round draw145- `10`: All hostages rescued146- `11`: Target saved147- `12`: Hostages not rescued148- `13`: Terrorists not escaped149- `14`: VIP not escaped150- `15`: Game commencing151- `16`: Terrorists surrender152- `17`: CTs surrender153154## DLL Information155156- **DLL**: `server.dll` (Windows) / `server.so` (Linux)157158## Notes159160- Both functions are regular functions, NOT virtual functions161- `CEntityInstance_AcceptInput` is called within `CCSGameRules_TerminateRound` to notify entities about round results162- The "CTsWin" input is sent when reason == 1 (CTs win)163- The "TerroristsWin" input is sent when reason == 2 (Terrorists win)164165## Output YAML Format166167The output YAML filename depends on the platform:168- `server.dll` -> `CCSGameRules_TerminateRound.windows.yaml`, `CEntityInstance_AcceptInput.windows.yaml`169- `server.so` -> `CCSGameRules_TerminateRound.linux.yaml`, `CEntityInstance_AcceptInput.linux.yaml`170171```yaml172func_va: 0x180XXXXXX # Virtual address of the function - This can change when game updates.173func_rva: 0xXXXXXX # Relative virtual address (VA - image base) - This can change when game updates.174func_size: 0xXXX # Function size in bytes - This can change when game updates.175func_sig: XX XX XX XX XX # Unique byte signature for pattern scanning - This can change when game updates.176```