SaveInit
0x004ac420 · 456 bytes · __cdecl
_Z8SaveIniti
Decompiled
undefined (1 param)
/* SaveInit(int) */
int * SaveInit(int param_1)
{
int iVar1;
int *piVar2;
int *piVar3;
void *__s;
int iVar4;
byte bVar5;
bVar5 = 0;
iVar4 = param_1 + 0x5a0;
if (param_1 < 1) {
iVar4 = 0x3005a0;
param_1 = 0x300000;
}
iVar1 = CGlobalEntityList::NumberOfEntities((CGlobalEntityList *)gEntList);
piVar2 = (int *)(**(code **)(*engine + 0x68))(engine,iVar4 + iVar1 * 0x38,1);
piVar3 = (int *)0x0;
if (piVar2 != (int *)0x0) {
do {
*(undefined4 *)((int)piVar2 + (int)piVar3) = 0;
piVar3 = piVar3 + 1;
} while (piVar3 < (int *)0x18);
piVar2[0x15d] = 0;
piVar2[0x15e] = 0;
piVar2[0x15f] = 0;
CUtlHash<CGameSaveRestoreInfo::CHashElement,CGameSaveRestoreInfo::CHashFuncs,CGameSaveRestoreInfo::CHashFuncs>
::CUtlHash(piVar2 + 0x160,0,0,0,0,0);
piVar3 = piVar2 + 6;
for (iVar4 = 0x154; iVar4 != 0; iVar4 = iVar4 + -1) {
*piVar3 = 0;
piVar3 = piVar3 + (uint)bVar5 * -2 + 1;
}
*(undefined1 *)(piVar2 + 0x167) = 0;
*piVar2 = (int)(piVar2 + 0x168);
piVar2[1] = (int)(piVar2 + 0x168);
piVar3 = engine;
piVar2[0x15a] = 0;
piVar2[0x15b] = 0;
piVar2[0x15c] = 0;
piVar2[2] = 0;
piVar2[3] = param_1;
__s = (void *)(**(code **)(*piVar3 + 0x68))(piVar3,0xfff,4);
if (__s == (void *)0x0) {
(**(code **)(*engine + 0x6c))(engine,0);
piVar3 = (int *)0x0;
}
else {
piVar2[4] = 0xfff;
piVar2[5] = (int)__s;
memset(__s,0,0x3ffc);
iVar1 = gpGlobals;
iVar4 = *(int *)(gpGlobals + 0xc);
piVar2[6] = 0;
piVar2[0x147] = 0;
piVar2[0x150] = iVar4;
piVar2[0x14d] = vec3_origin;
piVar2[0x14e] = DAT_01053d4c;
piVar2[0x14f] = DAT_01053d50;
*(int **)(iVar1 + 0x2c) = piVar2;
piVar3 = piVar2;
}
}
return piVar3;
}
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.