CUtlVector<CUtlVector<int,CUtlMemory<int,int>>,CUtlMemory<CUtlVector<int,CUtlMemory<int,int>>,int>>::SetCount
0x00b73d00 · 354 bytes · __thiscall
_ZN10CUtlVectorIS_Ii10CUtlMemoryIiiEES0_IS2_iEE8SetCountEi
Decompiled
undefined (2 params)
/* CUtlVector<CUtlVector<int, CUtlMemory<int, int> >, CUtlMemory<CUtlVector<int, CUtlMemory<int,
int> >, int> >::SetCount(int) */
void __thiscall
CUtlVector<CUtlVector<int,CUtlMemory<int,int>>,CUtlMemory<CUtlVector<int,CUtlMemory<int,int>>,int>>
::SetCount(CUtlVector<CUtlVector<int,CUtlMemory<int,int>>,CUtlMemory<CUtlVector<int,CUtlMemory<int,int>>,int>>
*this,int param_1)
{
int iVar1;
undefined4 *puVar2;
void *pvVar3;
int iVar4;
int iVar5;
int iVar6;
int iVar7;
RemoveAll(this);
iVar7 = *(int *)(this + 0xc);
if (param_1 == 0) {
return;
}
iVar6 = *(int *)(this + 4);
iVar4 = param_1 + iVar7;
iVar5 = iVar4;
if (iVar6 < iVar4) {
iVar1 = *(int *)(this + 8);
if (iVar1 < 0) goto LAB_00b73d3a;
if (iVar1 == 0) {
if (iVar6 == 0) {
if (iVar4 < 3) {
iVar6 = 2;
goto LAB_00b73ddf;
}
iVar6 = 2;
}
do {
iVar6 = iVar6 * 2;
} while (iVar6 < iVar4);
}
else {
for (iVar6 = ((iVar4 + -1) / iVar1 + 1) * iVar1; iVar6 < iVar4; iVar6 = (iVar6 + iVar4) / 2) {
}
}
LAB_00b73ddf:
*(int *)(this + 4) = iVar6;
if (*(void **)this == (void *)0x0) {
pvVar3 = malloc(iVar6 * 0x14);
*(void **)this = pvVar3;
}
else {
pvVar3 = realloc(*(void **)this,iVar6 * 0x14);
*(void **)this = pvVar3;
iVar5 = *(int *)(this + 0xc) + param_1;
}
}
else {
LAB_00b73d3a:
pvVar3 = *(void **)this;
}
*(int *)(this + 0xc) = iVar5;
iVar6 = (iVar5 - iVar7) - param_1;
*(void **)(this + 0x10) = pvVar3;
if (iVar6 < 1) {
if (0 < param_1) {
LAB_00b73d5c:
iVar4 = 0;
iVar7 = iVar7 * 0x14;
do {
puVar2 = (undefined4 *)(iVar7 + *(int *)this);
if (puVar2 != (undefined4 *)0x0) {
*puVar2 = 0;
puVar2[1] = 0;
puVar2[2] = 0;
puVar2[3] = 0;
puVar2[4] = 0;
}
iVar4 = iVar4 + 1;
iVar7 = iVar7 + 0x14;
} while (iVar4 < param_1);
return;
}
}
else if (0 < param_1) {
_V_memmove((void *)((int)pvVar3 + iVar4 * 0x14),(void *)((int)pvVar3 + iVar7 * 0x14),
iVar6 * 0x14);
goto LAB_00b73d5c;
}
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.