IterateActivePhysicsEntities
0x0077a750 · 179 bytes · __cdecl
_Z28IterateActivePhysicsEntitiesPFvP11CBaseEntityE
Decompiled
undefined (1 param)
/* IterateActivePhysicsEntities(void (*)(CBaseEntity*)) */
void IterateActivePhysicsEntities(_func_void_CBaseEntity_ptr *param_1)
{
code *pcVar1;
int *piVar2;
int iVar3;
_func_void_CBaseEntity_ptr *p_Var4;
char cVar5;
int iVar6;
int iVar7;
int **ppiVar8;
int iVar9;
int in_GS_OFFSET;
undefined4 uStack_40;
int *local_3c;
int aiStack_38 [2];
_func_void_CBaseEntity_ptr *local_30 [4];
int local_20;
local_30[0] = param_1;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
uStack_40 = 0x77a76f;
cVar5 = UTIL_IsCommandIssuedByServerAdmin();
ppiVar8 = &local_3c;
if (cVar5 != '\0') {
local_3c = physenv;
uStack_40 = 0x77a7a0;
iVar6 = (**(code **)(*physenv + 0xb8))();
ppiVar8 = &local_3c;
if (iVar6 != 0) {
iVar3 = -((iVar6 * 4 + 0xfU & 0xfffffff0) + 0x10);
iVar9 = *physenv;
*(int *)((int)aiStack_38 + iVar3) = (int)local_30 + iVar3;
*(int **)((int)aiStack_38 + iVar3 + -4) = physenv;
pcVar1 = *(code **)(iVar9 + 0xbc);
*(undefined4 *)((int)&uStack_40 + iVar3) = 0x77a7d0;
(*pcVar1)();
ppiVar8 = (int **)((int)aiStack_38 + iVar3 + -4);
if (0 < iVar6) {
iVar9 = 0;
do {
piVar2 = *(int **)((int)local_30 + iVar3 + iVar9 * 4);
iVar7 = *piVar2;
*(int **)((int)aiStack_38 + iVar3 + -4) = piVar2;
pcVar1 = *(code **)(iVar7 + 0x48);
*(undefined4 *)((int)&uStack_40 + iVar3) = 0x77a7eb;
iVar7 = (*pcVar1)();
if (iVar7 != 0) {
*(int *)((int)aiStack_38 + iVar3 + -4) = iVar7;
p_Var4 = local_30[0];
*(undefined4 *)((int)&uStack_40 + iVar3) = 0x77a7f7;
(*p_Var4)(*(CBaseEntity **)((int)aiStack_38 + iVar3 + -4));
}
iVar9 = iVar9 + 1;
ppiVar8 = (int **)((int)aiStack_38 + iVar3 + -4);
} while (iVar9 != iVar6);
}
}
}
if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
/* WARNING: Subroutine does not return */
*(undefined **)((int)ppiVar8 + -4) = &UNK_0077a808;
__stack_chk_fail();
}
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.