CSave::WriteEHandle
0x004a65d0 · 571 bytes · __thiscall
_ZN5CSave12WriteEHandleEPKcPK7CHandleI11CBaseEntityEi
Decompiled
undefined (4 params)
/* CSave::WriteEHandle(char const*, CHandle<CBaseEntity> const*, int) */
void __thiscall CSave::WriteEHandle(CSave *this,char *param_1,CHandle *param_2,int param_3)
{
int *piVar1;
int iVar2;
int iVar3;
uint uVar4;
undefined4 uVar5;
int *piVar6;
uint uVar7;
uint uVar8;
undefined *puVar9;
int iVar10;
undefined4 *puVar11;
undefined4 *local_1044;
int local_103c;
int local_1024 [2];
undefined4 local_101c [1027];
if (0 < param_3) {
local_103c = 0;
do {
uVar7 = *(uint *)(param_2 + local_103c * 4);
if (((uVar7 == 0xffffffff) ||
(puVar9 = g_pEntityList + (uVar7 & 0xfff) * 0x10, puVar9 == (undefined *)0xfffffffc)) ||
(*(uint *)(puVar9 + 8) != uVar7 >> 0xc)) {
LAB_004a6600:
uVar5 = 0xffffffff;
}
else {
iVar2 = *(int *)(puVar9 + 4);
iVar3 = *(int *)(this + 0x1c);
if (iVar2 == 0) goto LAB_004a6600;
if (*(int *)(iVar3 + 0x574) < 1) {
LAB_004a66b9:
if (0 < *(int *)(iVar3 + 0x55c)) {
puVar11 = *(undefined4 **)(iVar3 + 0x560);
iVar10 = 0;
do {
uVar7 = puVar11[4];
if (((uVar7 != 0xffffffff) &&
(puVar9 = g_pEntityList + (uVar7 & 0xfff) * 0x10,
puVar9 != (undefined *)0xfffffffc)) &&
((*(uint *)(puVar9 + 8) == uVar7 >> 0xc && (iVar2 == *(int *)(puVar9 + 4))))) {
uVar5 = *puVar11;
goto LAB_004a6605;
}
iVar10 = iVar10 + 1;
puVar11 = puVar11 + 0xe;
} while (iVar10 != *(int *)(iVar3 + 0x55c));
}
goto LAB_004a6600;
}
piVar6 = (int *)(*(int *)(iVar3 + 0x568) + 0xc);
piVar1 = piVar6 + *(int *)(iVar3 + 0x574) * 5;
iVar10 = 0;
do {
iVar10 = iVar10 + *piVar6;
piVar6 = piVar6 + 5;
} while (piVar6 != piVar1);
if (iVar10 == 0) goto LAB_004a66b9;
local_1024[0] = iVar2;
uVar7 = Hash4(local_1024);
if (*(char *)(iVar3 + 0x57e) == '\0') {
uVar7 = uVar7 % *(uint *)(iVar3 + 0x574);
}
else {
uVar7 = uVar7 & *(uint *)(iVar3 + 0x580);
}
piVar1 = (int *)(*(int *)(iVar3 + 0x568) + uVar7 * 0x14);
uVar4 = piVar1[3];
if ((int)uVar4 < 1) {
if (uVar4 == 0) goto LAB_004a6600;
uVar8 = 0;
}
else {
piVar1 = (int *)*piVar1;
uVar8 = 0;
iVar2 = *piVar1;
while (iVar2 != local_1024[0]) {
uVar8 = uVar8 + 1;
if (uVar8 == uVar4) goto LAB_004a6600;
iVar2 = piVar1[uVar8 * 2];
}
}
uVar7 = uVar7 << 0x10 | uVar8;
if (uVar7 == 0xffffffff) goto LAB_004a6600;
uVar5 = *(undefined4 *)
(*(int *)(*(int *)(iVar3 + 0x568) + (uVar7 >> 0x10) * 0x14) + 4 +
(uVar8 & 0xffff) * 8);
}
LAB_004a6605:
iVar2 = local_103c + 1;
local_101c[local_103c] = uVar5;
} while ((iVar2 < 0x400) && (local_103c = iVar2, iVar2 < param_3));
}
local_1044 = local_101c;
(**(code **)(*(int *)this + 0x58))(this,param_1,local_1044,param_3);
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.