CUtlVector<CHandle<CVGuiScreen>,CUtlMemory<CHandle<CVGuiScreen>,int>>::InsertBefore
0x0041d600 · 222 bytes · __thiscall
_ZN10CUtlVectorI7CHandleI11CVGuiScreenE10CUtlMemoryIS2_iEE12InsertBeforeEi
Decompiled
undefined (2 params)
/* CUtlVector<CHandle<CVGuiScreen>, CUtlMemory<CHandle<CVGuiScreen>, int> >::InsertBefore(int) */
int __thiscall
CUtlVector<CHandle<CVGuiScreen>,CUtlMemory<CHandle<CVGuiScreen>,int>>::InsertBefore
(CUtlVector<CHandle<CVGuiScreen>,CUtlMemory<CHandle<CVGuiScreen>,int>> *this,int param_1)
{
int iVar1;
void *pvVar2;
int iVar3;
int iVar4;
iVar3 = *(int *)(this + 4);
iVar4 = *(int *)(this + 0xc) + 1;
if (iVar3 < iVar4) {
iVar1 = *(int *)(this + 8);
if (-1 < iVar1) {
if (iVar1 == 0) {
if (iVar3 == 0) {
if (iVar4 < 9) {
iVar3 = 8;
goto LAB_0041d686;
}
iVar3 = 8;
}
do {
iVar3 = iVar3 * 2;
} while (iVar3 < iVar4);
}
else {
for (iVar3 = iVar1 * (*(int *)(this + 0xc) / iVar1 + 1); iVar3 < iVar4;
iVar3 = (iVar3 + iVar4) / 2) {
}
}
LAB_0041d686:
*(int *)(this + 4) = iVar3;
if (*(void **)this == (void *)0x0) {
pvVar2 = malloc(iVar3 << 2);
*(void **)this = pvVar2;
}
else {
pvVar2 = realloc(*(void **)this,iVar3 << 2);
*(void **)this = pvVar2;
iVar4 = *(int *)(this + 0xc) + 1;
}
goto LAB_0041d61e;
}
}
pvVar2 = *(void **)this;
LAB_0041d61e:
*(int *)(this + 0xc) = iVar4;
iVar4 = (iVar4 - param_1) + -1;
*(void **)(this + 0x10) = pvVar2;
iVar3 = param_1 * 4;
if (0 < iVar4) {
_V_memmove((void *)((int)pvVar2 + iVar3 + 4),(void *)((int)pvVar2 + iVar3),iVar4 * 4);
pvVar2 = *(void **)this;
}
if ((undefined4 *)((int)pvVar2 + iVar3) != (undefined4 *)0x0) {
*(undefined4 *)((int)pvVar2 + iVar3) = 0xffffffff;
}
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.