CUtlVector<CDownloadListGenerator::WhiteListFileData,CUtlMemory<CDownloadListGenerator::WhiteListFileData,int>>::InsertBefore
0x00140960 · 241 bytes · __thiscall
_ZN10CUtlVectorIN22CDownloadListGenerator17WhiteListFileDataE10CUtlMemoryIS1_iEE12InsertBeforeEiRKS1_
Decompiled
undefined (3 params)
/* CUtlVector<CDownloadListGenerator::WhiteListFileData,
CUtlMemory<CDownloadListGenerator::WhiteListFileData, int> >::InsertBefore(int,
CDownloadListGenerator::WhiteListFileData const&) */
int __thiscall
CUtlVector<CDownloadListGenerator::WhiteListFileData,CUtlMemory<CDownloadListGenerator::WhiteListFileData,int>>
::InsertBefore(CUtlVector<CDownloadListGenerator::WhiteListFileData,CUtlMemory<CDownloadListGenerator::WhiteListFileData,int>>
*this,int param_1,WhiteListFileData *param_2)
{
int iVar1;
void *pvVar2;
int iVar3;
int iVar4;
WhiteListFileData *pWVar5;
byte bVar6;
bVar6 = 0;
iVar4 = *(int *)(this + 4);
iVar3 = *(int *)(this + 0xc) + 1;
if (iVar4 < iVar3) {
iVar1 = *(int *)(this + 8);
if (-1 < iVar1) {
if (iVar1 == 0) {
if (iVar4 == 0) {
if (iVar3 < 2) {
iVar4 = 1;
goto LAB_001409f6;
}
iVar4 = 1;
}
do {
iVar4 = iVar4 * 2;
} while (iVar4 < iVar3);
}
else {
for (iVar4 = iVar1 * (*(int *)(this + 0xc) / iVar1 + 1); iVar4 < iVar3;
iVar4 = (iVar4 + iVar3) / 2) {
}
}
LAB_001409f6:
*(int *)(this + 4) = iVar4;
if (*(void **)this == (void *)0x0) {
pvVar2 = malloc(iVar4 * 0x115);
*(void **)this = pvVar2;
}
else {
pvVar2 = realloc(*(void **)this,iVar4 * 0x115);
*(void **)this = pvVar2;
iVar3 = *(int *)(this + 0xc) + 1;
}
goto LAB_0014097e;
}
}
pvVar2 = *(void **)this;
LAB_0014097e:
*(int *)(this + 0xc) = iVar3;
iVar3 = (iVar3 - param_1) + -1;
iVar4 = param_1 * 0x115;
*(void **)(this + 0x10) = pvVar2;
if (0 < iVar3) {
_V_memmove((void *)((int)pvVar2 + iVar4 + 0x115),(void *)((int)pvVar2 + iVar4),iVar3 * 0x115);
pvVar2 = *(void **)this;
}
if ((WhiteListFileData *)((int)pvVar2 + iVar4) != (WhiteListFileData *)0x0) {
pWVar5 = (WhiteListFileData *)((int)pvVar2 + iVar4);
for (iVar3 = 0x45; iVar3 != 0; iVar3 = iVar3 + -1) {
*(undefined4 *)pWVar5 = *(undefined4 *)param_2;
param_2 = param_2 + (uint)bVar6 * -8 + 4;
pWVar5 = pWVar5 + (uint)bVar6 * -8 + 4;
}
*pWVar5 = *param_2;
}
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.