CUtlMemoryPool::AddNewBlob
0x00254b50 · 168 bytes · __thiscall
_ZN14CUtlMemoryPool10AddNewBlobEv
Decompiled
undefined (1 param)
/* CUtlMemoryPool::AddNewBlob() */
void __thiscall CUtlMemoryPool::AddNewBlob(CUtlMemoryPool *this)
{
int *piVar1;
undefined4 *puVar2;
undefined4 *puVar3;
int iVar4;
int iVar5;
if (*(int *)(this + 8) == 2) {
iVar5 = 1;
}
else {
if ((*(int *)(this + 8) == 0) && (*(ushort *)(this + 0x1a) != 0)) {
return;
}
iVar5 = *(ushort *)(this + 0x1a) + 1;
}
iVar4 = *(int *)this;
iVar5 = iVar5 * *(int *)(this + 4);
piVar1 = malloc(iVar4 * iVar5 + 0xe + (uint)*(ushort *)(this + 0x18));
piVar1[2] = iVar4 * iVar5;
piVar1[1] = (int)(this + 0x20);
iVar4 = *(int *)(this + 0x20);
*piVar1 = iVar4;
*(int **)(iVar4 + 4) = piVar1;
*(int **)(this + 0x20) = piVar1;
puVar2 = (undefined4 *)
((int)piVar1 + *(ushort *)(this + 0x18) + 0xb & -(uint)*(ushort *)(this + 0x18));
*(undefined4 **)(this + 0xc) = puVar2;
if (1 < iVar5) {
iVar4 = 0;
puVar3 = puVar2;
do {
iVar4 = iVar4 + 1;
puVar2 = (undefined4 *)(*(int *)this + (int)puVar3);
*puVar3 = puVar2;
puVar3 = puVar2;
} while (iVar4 != iVar5 + -1);
}
*puVar2 = 0;
*(short *)(this + 0x1a) = *(short *)(this + 0x1a) + 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.