CUtlVector<GCSDK::CTriggerInfo,CUtlMemory<GCSDK::CTriggerInfo,int>>::InsertBefore
0x00089cc0 · 316 bytes · __thiscall
_ZN10CUtlVectorIN5GCSDK12CTriggerInfoE10CUtlMemoryIS1_iEE12InsertBeforeEiRKS1_
Decompiled
undefined (3 params)
/* CUtlVector<GCSDK::CTriggerInfo, CUtlMemory<GCSDK::CTriggerInfo, int> >::InsertBefore(int,
GCSDK::CTriggerInfo const&) */
int __thiscall
CUtlVector<GCSDK::CTriggerInfo,CUtlMemory<GCSDK::CTriggerInfo,int>>::InsertBefore
(CUtlVector<GCSDK::CTriggerInfo,CUtlMemory<GCSDK::CTriggerInfo,int>> *this,int param_1,
CTriggerInfo *param_2)
{
CTriggerInfo *pCVar1;
void *pvVar2;
int iVar3;
int iVar4;
CTriggerInfo *pCVar5;
int iVar6;
CTriggerInfo *pCVar7;
byte bVar8;
bVar8 = 0;
iVar6 = *(int *)(this + 4);
iVar3 = *(int *)(this + 0xc) + 1;
if (iVar6 < iVar3) {
iVar4 = *(int *)(this + 8);
if (-1 < iVar4) {
if (iVar4 == 0) {
if (iVar6 == 0) {
if (iVar3 < 2) {
iVar4 = 1;
goto LAB_00089da7;
}
iVar6 = 1;
}
do {
iVar4 = iVar6 * 2;
if (iVar3 <= iVar4) break;
iVar4 = iVar6 * 4;
iVar6 = iVar4;
} while (iVar4 < iVar3);
}
else {
for (iVar4 = iVar4 * (*(int *)(this + 0xc) / iVar4 + 1); iVar4 < iVar3;
iVar4 = (iVar4 + iVar3) / 2) {
}
}
LAB_00089da7:
*(int *)(this + 4) = iVar4;
if (*(void **)this == (void *)0x0) {
pvVar2 = malloc(iVar4 * 0x11c);
*(void **)this = pvVar2;
}
else {
pvVar2 = realloc(*(void **)this,iVar4 * 0x11c);
*(void **)this = pvVar2;
iVar3 = *(int *)(this + 0xc) + 1;
}
goto LAB_00089ce2;
}
}
pvVar2 = *(void **)this;
LAB_00089ce2:
*(int *)(this + 0xc) = iVar3;
*(void **)(this + 0x10) = pvVar2;
iVar3 = (iVar3 - param_1) + -1;
iVar6 = param_1 * 0x11c;
if (0 < iVar3) {
_V_memmove((void *)((int)pvVar2 + iVar6 + 0x11c),(void *)((int)pvVar2 + iVar6),iVar3 * 0x11c);
pvVar2 = *(void **)this;
}
pCVar1 = (CTriggerInfo *)((int)pvVar2 + iVar6);
if (pCVar1 != (CTriggerInfo *)0x0) {
*pCVar1 = *param_2;
*(undefined4 *)(pCVar1 + 4) = *(undefined4 *)(param_2 + 4);
*(undefined4 *)(pCVar1 + 8) = *(undefined4 *)(param_2 + 8);
pCVar5 = param_2 + 0xc;
pCVar7 = pCVar1 + 0xc;
for (iVar3 = 0x20; iVar3 != 0; iVar3 = iVar3 + -1) {
*(undefined4 *)pCVar7 = *(undefined4 *)pCVar5;
pCVar5 = pCVar5 + (uint)bVar8 * -8 + 4;
pCVar7 = pCVar7 + (uint)bVar8 * -8 + 4;
}
pCVar5 = param_2 + 0x8c;
pCVar7 = pCVar1 + 0x8c;
for (iVar3 = 0x20; iVar3 != 0; iVar3 = iVar3 + -1) {
*(undefined4 *)pCVar7 = *(undefined4 *)pCVar5;
pCVar5 = pCVar5 + (uint)bVar8 * -8 + 4;
pCVar7 = pCVar7 + (uint)bVar8 * -8 + 4;
}
CUtlString::CUtlString((CUtlString *)(pCVar1 + 0x10c),(CUtlString *)(param_2 + 0x10c));
}
return param_1;
}
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.