CUtlVector<rr2::CResponseQuery::CFact,CUtlMemory<rr2::CResponseQuery::CFact,int>>::InsertBefore
0x00bd9710 · 317 bytes · __thiscall
_ZN10CUtlVectorIN3rr214CResponseQuery5CFactE10CUtlMemoryIS2_iEE12InsertBeforeEiRKS2_
Decompiled
undefined (3 params)
/* CUtlVector<rr2::CResponseQuery::CFact, CUtlMemory<rr2::CResponseQuery::CFact, int>
>::InsertBefore(int, rr2::CResponseQuery::CFact const&) */
int __thiscall
CUtlVector<rr2::CResponseQuery::CFact,CUtlMemory<rr2::CResponseQuery::CFact,int>>::InsertBefore
(CUtlVector<rr2::CResponseQuery::CFact,CUtlMemory<rr2::CResponseQuery::CFact,int>> *this,
int param_1,CFact *param_2)
{
int iVar1;
undefined2 *puVar2;
void *pvVar3;
int iVar4;
int iVar5;
iVar4 = *(int *)(this + 4);
iVar5 = *(int *)(this + 0xc) + 1;
if (iVar4 < iVar5) {
iVar1 = *(int *)(this + 8);
if (iVar1 < 0) goto LAB_00bd9732;
if (iVar1 == 0) {
if (iVar4 == 0) {
if (iVar5 < 3) {
iVar4 = 2;
goto LAB_00bd97a6;
}
iVar4 = 2;
}
do {
iVar4 = iVar4 * 2;
} while (iVar4 < iVar5);
}
else {
for (iVar4 = iVar1 * (*(int *)(this + 0xc) / iVar1 + 1); iVar4 < iVar5;
iVar4 = (iVar4 + iVar5) / 2) {
}
}
LAB_00bd97a6:
*(int *)(this + 4) = iVar4;
if (*(void **)this != (void *)0x0) {
pvVar3 = realloc(*(void **)this,iVar4 << 4);
iVar5 = *(int *)(this + 0xc);
*(void **)this = pvVar3;
*(void **)(this + 0x10) = pvVar3;
*(int *)(this + 0xc) = iVar5 + 1;
iVar5 = (iVar5 + 1) - param_1;
goto joined_r0x00bd97dd;
}
pvVar3 = malloc(iVar4 << 4);
*(void **)this = pvVar3;
}
else {
LAB_00bd9732:
pvVar3 = *(void **)this;
}
*(int *)(this + 0xc) = iVar5;
iVar5 = iVar5 - param_1;
*(void **)(this + 0x10) = pvVar3;
joined_r0x00bd97dd:
if (0 < iVar5 + -1) {
_V_memmove((void *)((int)pvVar3 + param_1 * 0x10 + 0x10),(void *)((int)pvVar3 + param_1 * 0x10),
(iVar5 + -1) * 0x10);
pvVar3 = *(void **)this;
}
puVar2 = (undefined2 *)((int)pvVar3 + param_1 * 0x10);
if (puVar2 != (undefined2 *)0x0) {
*puVar2 = *(undefined2 *)param_2;
*(undefined4 *)(puVar2 + 2) = *(undefined4 *)(param_2 + 4);
*(undefined4 *)(puVar2 + 4) = *(undefined4 *)(param_2 + 8);
*(undefined4 *)(puVar2 + 6) = *(undefined4 *)(param_2 + 0xc);
}
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.