_ServerDTI_HookTimer
0x0014c0f0 · 144 bytes · __cdecl
_Z20_ServerDTI_HookTimerPK9SendTable18ServerDTITimerTypeRK11CCycleCount
Decompiled
undefined (3 params)
/* _ServerDTI_HookTimer(SendTable const*, ServerDTITimerType, CCycleCount const&) */
void _ServerDTI_HookTimer(int param_1,int param_2,uint *param_3)
{
uint *puVar1;
uint uVar2;
int iVar3;
uint uVar4;
uint uVar5;
undefined8 uVar6;
bool bVar7;
if ((*(int *)(param_1 + 0xc) != 0) &&
(iVar3 = *(int *)(*(int *)(param_1 + 0xc) + 0x90), iVar3 != 0)) {
if (g_bFirstHookTimer != '\0') {
uVar6 = rdtsc();
DAT_0039f4f4 = (undefined4)((ulonglong)uVar6 >> 0x20);
g_ServerDTITimer = (undefined4)uVar6;
g_bFirstHookTimer = '\0';
}
uVar4 = param_3[1];
uVar5 = *param_3;
bVar7 = CARRY4((uint)g_TotalServerDTICycles,uVar5);
g_TotalServerDTICycles._0_4_ = (uint)g_TotalServerDTICycles + uVar5;
g_TotalServerDTICycles._4_4_ = g_TotalServerDTICycles._4_4_ + uVar4 + (uint)bVar7;
if (param_2 == 0) {
puVar1 = (uint *)(iVar3 + 0x10);
uVar2 = *puVar1;
*puVar1 = *puVar1 + uVar5;
*(int *)(iVar3 + 0x14) = *(int *)(iVar3 + 0x14) + uVar4 + (uint)CARRY4(uVar2,uVar5);
*(int *)(iVar3 + 0x18) = *(int *)(iVar3 + 0x18) + 1;
return;
}
if (param_2 == 1) {
puVar1 = (uint *)(iVar3 + 0x1c);
uVar2 = *puVar1;
*puVar1 = *puVar1 + uVar5;
*(int *)(iVar3 + 0x20) = *(int *)(iVar3 + 0x20) + uVar4 + (uint)CARRY4(uVar2,uVar5);
*(int *)(iVar3 + 0x24) = *(int *)(iVar3 + 0x24) + 1;
}
else if (param_2 == 2) {
puVar1 = (uint *)(iVar3 + 0x28);
uVar2 = *puVar1;
*puVar1 = *puVar1 + uVar5;
*(int *)(iVar3 + 0x2c) = *(int *)(iVar3 + 0x2c) + uVar4 + (uint)CARRY4(uVar2,uVar5);
*(int *)(iVar3 + 0x30) = *(int *)(iVar3 + 0x30) + 1;
}
else if (param_2 == 3) {
puVar1 = (uint *)(iVar3 + 0x34);
uVar2 = *puVar1;
*puVar1 = *puVar1 + uVar5;
*(int *)(iVar3 + 0x38) = *(int *)(iVar3 + 0x38) + uVar4 + (uint)CARRY4(uVar2,uVar5);
return;
}
}
return;
}
SourceMod gamedata
paste intoaddons/sourcemod/gamedata/<your_plugin>.txt
used as the SourceMod key — change to fit your plugin's convention
SourceMod library name (server / engine / matchmaking)
Just a Signatures{} block, ready to drop into a gamedata
file. Wire it up in your plugin however you like - SDKCall, DHooks,
raw memory ops, or anything else.
Signatures + Functions block. The plugin uses
DHookCreateFromConf - DHooks reads return type, this-type,
calling convention, and argument types straight from the gamedata. Less
boilerplate in the plugin, types travel with the gamedata.
Gamedata KeyValues
DHooks plugin example
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.