CUtlVector<CUtlVector<VoiceCommandMenuItem_t,CUtlMemory<VoiceCommandMenuItem_t,int>>,CUtlMemory<CUtlVector<VoiceCommandMenuItem_t,CUtlMemory<VoiceCommandMenuItem_t,int>>,int>>::InsertBefore
0x00470550 · 267 bytes · __thiscall
_ZN10CUtlVectorIS_I22VoiceCommandMenuItem_t10CUtlMemoryIS0_iEES1_IS3_iEE12InsertBeforeEi
Decompiled
undefined (2 params)
/* CUtlVector<CUtlVector<VoiceCommandMenuItem_t, CUtlMemory<VoiceCommandMenuItem_t, int> >,
CUtlMemory<CUtlVector<VoiceCommandMenuItem_t, CUtlMemory<VoiceCommandMenuItem_t, int> >, int>
>::InsertBefore(int) */
int __thiscall
CUtlVector<CUtlVector<VoiceCommandMenuItem_t,CUtlMemory<VoiceCommandMenuItem_t,int>>,CUtlMemory<CUtlVector<VoiceCommandMenuItem_t,CUtlMemory<VoiceCommandMenuItem_t,int>>,int>>
::InsertBefore(CUtlVector<CUtlVector<VoiceCommandMenuItem_t,CUtlMemory<VoiceCommandMenuItem_t,int>>,CUtlMemory<CUtlVector<VoiceCommandMenuItem_t,CUtlMemory<VoiceCommandMenuItem_t,int>>,int>>
*this,int param_1)
{
undefined4 *puVar1;
void *pvVar2;
int iVar3;
int iVar4;
int iVar5;
iVar5 = *(int *)(this + 4);
iVar4 = *(int *)(this + 0xc) + 1;
if (iVar5 < iVar4) {
iVar3 = *(int *)(this + 8);
if (-1 < iVar3) {
if (iVar3 == 0) {
if (iVar5 == 0) {
if (iVar4 < 3) {
iVar3 = 2;
goto LAB_004705ff;
}
iVar5 = 2;
}
do {
iVar3 = iVar5 * 2;
if (iVar4 <= iVar3) break;
iVar3 = iVar5 * 4;
iVar5 = iVar3;
} while (iVar3 < iVar4);
}
else {
for (iVar3 = iVar3 * (*(int *)(this + 0xc) / iVar3 + 1); iVar3 < iVar4;
iVar3 = (iVar3 + iVar4) / 2) {
}
}
LAB_004705ff:
*(int *)(this + 4) = iVar3;
if (*(void **)this == (void *)0x0) {
pvVar2 = malloc(iVar3 * 0x14);
*(void **)this = pvVar2;
}
else {
pvVar2 = realloc(*(void **)this,iVar3 * 0x14);
*(void **)this = pvVar2;
iVar4 = *(int *)(this + 0xc) + 1;
}
goto LAB_0047056e;
}
}
pvVar2 = *(void **)this;
LAB_0047056e:
*(int *)(this + 0xc) = iVar4;
iVar4 = (iVar4 - param_1) + -1;
*(void **)(this + 0x10) = pvVar2;
iVar5 = param_1 * 0x14;
if (0 < iVar4) {
_V_memmove((void *)((int)pvVar2 + iVar5 + 0x14),(void *)((int)pvVar2 + iVar5),iVar4 * 0x14);
pvVar2 = *(void **)this;
}
puVar1 = (undefined4 *)((int)pvVar2 + iVar5);
if (puVar1 != (undefined4 *)0x0) {
*puVar1 = 0;
puVar1[1] = 0;
puVar1[2] = 0;
puVar1[3] = 0;
puVar1[4] = 0;
}
return param_1;
}
SourceMod gamedata
paste intoaddons/sourcemod/gamedata/<your_plugin>.txt
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.
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.