CInitTracker::Init
0x0021bf10 · 309 bytes · __thiscall
_ZN12CInitTracker4InitEPKcS1_i
Decompiled
undefined (4 params)
/* CInitTracker::Init(char const*, char const*, int) */
void __thiscall CInitTracker::Init(CInitTracker *this,char *param_1,char *param_2,int param_3)
{
CInitTracker *pCVar1;
CInitTracker *pCVar2;
int iVar3;
undefined4 *puVar4;
undefined4 *puVar5;
int iVar6;
int iVar7;
int iVar8;
puVar4 = operator_new(0x1c);
*puVar4 = param_1;
puVar4[1] = param_2;
pCVar1 = this + param_3 * 4;
iVar8 = *(int *)pCVar1;
pCVar2 = this + param_3 * 0x14 + 0x10;
puVar4[2] = 1;
*(undefined1 *)(puVar4 + 4) = 0;
puVar4[5] = 0;
puVar4[6] = 0;
puVar4[3] = iVar8;
iVar7 = *(int *)(pCVar2 + 0xc);
iVar6 = *(int *)(pCVar2 + 4);
iVar8 = iVar7 + 1;
if (iVar6 < iVar8) {
iVar3 = *(int *)(pCVar2 + 8);
if (-1 < iVar3) {
if (iVar3 == 0) {
if (iVar6 == 0) {
if (iVar8 < 9) {
iVar6 = 8;
goto LAB_0021bfde;
}
iVar6 = 8;
}
do {
iVar6 = iVar6 * 2;
} while (iVar6 < iVar8);
}
else {
for (iVar6 = (iVar7 / iVar3 + 1) * iVar3; iVar6 < iVar8; iVar6 = (iVar6 + iVar8) / 2) {
}
}
LAB_0021bfde:
*(int *)(pCVar2 + 4) = iVar6;
if (*(void **)pCVar2 == (void *)0x0) {
puVar5 = malloc(iVar6 << 2);
*(undefined4 **)pCVar2 = puVar5;
}
else {
puVar5 = realloc(*(void **)pCVar2,iVar6 << 2);
iVar7 = *(int *)(pCVar2 + 0xc);
*(undefined4 **)pCVar2 = puVar5;
iVar8 = iVar7 + 1;
}
goto LAB_0021bf78;
}
}
puVar5 = *(undefined4 **)pCVar2;
LAB_0021bf78:
*(int *)(pCVar2 + 0xc) = iVar8;
*(undefined4 **)(pCVar2 + 0x10) = puVar5;
if (0 < iVar7) {
_V_memmove(puVar5 + 1,puVar5,iVar7 * 4);
puVar5 = *(undefined4 **)pCVar2;
}
if (puVar5 != (undefined4 *)0x0) {
*puVar5 = puVar4;
}
*(int *)pCVar1 = *(int *)pCVar1 + 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.