CUtlSortVector<CSortedCacheFile,CSortedCacheFile>::InsertNoSort
0x0061ac60 · 244 bytes · __thiscall
_ZN14CUtlSortVectorI16CSortedCacheFileS0_E12InsertNoSortERKS0_
Decompiled
undefined (2 params)
/* CUtlSortVector<CSortedCacheFile, CSortedCacheFile>::InsertNoSort(CSortedCacheFile const&) */
int __thiscall
CUtlSortVector<CSortedCacheFile,CSortedCacheFile>::InsertNoSort
(CUtlSortVector<CSortedCacheFile,CSortedCacheFile> *this,CSortedCacheFile *param_1)
{
int iVar1;
undefined4 uVar2;
undefined4 *puVar3;
int iVar4;
void *pvVar5;
int iVar6;
int iVar7;
iVar1 = *(int *)(this + 0xc);
this[0x18] = (CUtlSortVector<CSortedCacheFile,CSortedCacheFile>)0x1;
iVar6 = *(int *)(this + 4);
iVar7 = iVar1 + 1;
if (iVar6 < iVar7) {
iVar4 = *(int *)(this + 8);
if (-1 < iVar4) {
if (iVar4 == 0) {
if (iVar6 == 0) {
if (iVar7 < 5) {
iVar4 = 4;
goto LAB_0061acff;
}
iVar6 = 4;
}
do {
iVar4 = iVar6 * 2;
if (iVar7 <= iVar4) break;
iVar4 = iVar6 * 4;
iVar6 = iVar4;
} while (iVar4 < iVar7);
}
else {
for (iVar4 = (iVar1 / iVar4 + 1) * iVar4; iVar4 < iVar7; iVar4 = (iVar4 + iVar7) / 2) {
}
}
LAB_0061acff:
*(int *)(this + 4) = iVar4;
if (*(void **)this == (void *)0x0) {
pvVar5 = malloc(iVar4 << 3);
*(void **)this = pvVar5;
}
else {
pvVar5 = realloc(*(void **)this,iVar4 << 3);
*(void **)this = pvVar5;
iVar7 = *(int *)(this + 0xc) + 1;
}
goto LAB_0061ac7f;
}
}
pvVar5 = *(void **)this;
LAB_0061ac7f:
*(int *)(this + 0xc) = iVar7;
iVar7 = (iVar7 - iVar1) + -1;
*(void **)(this + 0x10) = pvVar5;
iVar6 = iVar1 * 8;
if (0 < iVar7) {
_V_memmove((void *)((int)pvVar5 + iVar6 + 8),(void *)((int)pvVar5 + iVar6),iVar7 * 8);
pvVar5 = *(void **)this;
}
puVar3 = (undefined4 *)((int)pvVar5 + iVar6);
if (puVar3 != (undefined4 *)0x0) {
uVar2 = *(undefined4 *)(param_1 + 4);
*puVar3 = *(undefined4 *)param_1;
puVar3[1] = uVar2;
}
return iVar1;
}
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.