FindHLTVDataInSnapshot
0x00171840 · 208 bytes · __cdecl
_Z22FindHLTVDataInSnapshotP14CFrameSnapshoti
Decompiled
undefined (2 params)
/* FindHLTVDataInSnapshot(CFrameSnapshot*, int) */
int FindHLTVDataInSnapshot(CFrameSnapshot *param_1,int param_2)
{
ushort *puVar1;
int iVar2;
int iVar3;
uint uVar4;
int local_14;
iVar3 = *(int *)(param_1 + 0x14) + -1;
puVar1 = *(ushort **)(param_1 + 0x10);
if (((param_2 < (int)(uint)*puVar1) || ((int)(uint)puVar1[iVar3] < param_2)) || (iVar3 < 1)) {
return 0;
}
local_14 = iVar3 >> 1;
uVar4 = (uint)puVar1[local_14];
if (uVar4 != param_2) {
iVar2 = 0;
do {
if ((int)uVar4 < param_2) {
if ((uint)puVar1[iVar3] == param_2) {
return iVar3 * 0x10 + *(int *)(param_1 + 0x18);
}
if (iVar2 == local_14) {
return 0;
}
iVar2 = local_14;
if (iVar3 <= local_14) {
return 0;
}
}
else {
if ((uint)puVar1[iVar2] == param_2) {
return iVar2 * 0x10 + *(int *)(param_1 + 0x18);
}
if (iVar3 == local_14) {
return 0;
}
iVar3 = local_14;
if (local_14 <= iVar2) {
return 0;
}
}
local_14 = (iVar2 + iVar3) / 2;
uVar4 = (uint)puVar1[local_14];
} while (uVar4 != param_2);
}
return local_14 * 0x10 + *(int *)(param_1 + 0x18);
}
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.