CSaveRestoreBlockSet::AddBlockHandler
0x004aca20 · 231 bytes · __thiscall
_ZN20CSaveRestoreBlockSet15AddBlockHandlerEP24ISaveRestoreBlockHandler
Decompiled
undefined (2 params)
/* CSaveRestoreBlockSet::AddBlockHandler(ISaveRestoreBlockHandler*) */
void __thiscall
CSaveRestoreBlockSet::AddBlockHandler(CSaveRestoreBlockSet *this,ISaveRestoreBlockHandler *param_1)
{
int iVar1;
int iVar2;
void *pvVar3;
int iVar4;
int iVar5;
iVar1 = *(int *)(this + 0x30);
iVar5 = *(int *)(this + 0x28);
iVar4 = iVar1 + 1;
if (iVar5 < iVar4) {
iVar2 = *(int *)(this + 0x2c);
if (-1 < iVar2) {
if (iVar2 == 0) {
if (iVar5 == 0) {
if (iVar4 < 9) {
iVar2 = 8;
goto LAB_004acaaf;
}
iVar5 = 8;
}
do {
iVar2 = iVar5 * 2;
if (iVar4 <= iVar2) break;
iVar2 = iVar5 * 4;
iVar5 = iVar2;
} while (iVar2 < iVar4);
}
else {
for (iVar2 = (iVar1 / iVar2 + 1) * iVar2; iVar2 < iVar4; iVar2 = (iVar2 + iVar4) / 2) {
}
}
LAB_004acaaf:
*(int *)(this + 0x28) = iVar2;
if (*(void **)(this + 0x24) == (void *)0x0) {
pvVar3 = malloc(iVar2 << 2);
*(void **)(this + 0x24) = pvVar3;
}
else {
pvVar3 = realloc(*(void **)(this + 0x24),iVar2 << 2);
*(void **)(this + 0x24) = pvVar3;
iVar4 = *(int *)(this + 0x30) + 1;
}
goto LAB_004aca3c;
}
}
pvVar3 = *(void **)(this + 0x24);
LAB_004aca3c:
*(int *)(this + 0x30) = iVar4;
iVar5 = iVar1 * 4;
iVar4 = (iVar4 - iVar1) + -1;
*(void **)(this + 0x34) = pvVar3;
if (0 < iVar4) {
_V_memmove((void *)((int)pvVar3 + iVar5 + 4),(void *)((int)pvVar3 + iVar5),iVar4 * 4);
pvVar3 = *(void **)(this + 0x24);
}
if ((undefined4 *)(iVar5 + (int)pvVar3) != (undefined4 *)0x0) {
*(undefined4 *)(iVar5 + (int)pvVar3) = param_1;
}
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.