CGlobalEntityList::FindEntityByClassnameFast
0x0067c0b0 · 164 bytes · __thiscall
_ZN17CGlobalEntityList25FindEntityByClassnameFastEP11CBaseEntity8string_t
Decompiled
undefined (3 params)
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* CGlobalEntityList::FindEntityByClassnameFast(CBaseEntity*, string_t) */
undefined4 __thiscall
CGlobalEntityList::FindEntityByClassnameFast(undefined4 this,int param_1,undefined1 *param_3)
{
undefined4 *puVar1;
uint uVar2;
undefined1 *puVar3;
uint uVar4;
uint uVar5;
if (param_1 != 0) {
return *(undefined4 *)(param_1 + 0x3d8);
}
puVar3 = &DAT_00d539c2;
if (param_3 != (undefined1 *)0x0) {
puVar3 = param_3;
}
uVar4 = HashInt((int)puVar3);
if (DAT_00fc9116 == '\0') {
uVar4 = uVar4 % DAT_00fc910c;
}
else {
uVar4 = uVar4 & _DAT_00fc9118;
}
puVar1 = (undefined4 *)(g_EntsByClassname + uVar4 * 0x14);
uVar2 = puVar1[3];
if ((int)uVar2 < 1) {
if (uVar2 == 0) {
return 0;
}
uVar5 = 0;
}
else {
puVar1 = (undefined4 *)*puVar1;
uVar5 = 0;
puVar3 = (undefined1 *)*puVar1;
while (param_3 != puVar3) {
uVar5 = uVar5 + 1;
if (uVar5 == uVar2) {
return 0;
}
puVar3 = (undefined1 *)puVar1[uVar5 * 2];
}
}
uVar4 = uVar4 << 0x10 | uVar5;
if (uVar4 == 0xffffffff) {
return 0;
}
return *(undefined4 *)
(*(int *)(g_EntsByClassname + (uVar4 >> 0x10) * 0x14) + 4 + (uVar5 & 0xffff) * 8);
}
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.