CUtlVector<CNetworkStringTableItem::itemchange_s,CUtlMemory<CNetworkStringTableItem::itemchange_s,int>>::InsertBefore
0x001acd80 · 327 bytes · __thiscall
_ZN10CUtlVectorIN23CNetworkStringTableItem12itemchange_sE10CUtlMemoryIS1_iEE12InsertBeforeEiRKS1_
Decompiled
undefined (3 params)
/* CUtlVector<CNetworkStringTableItem::itemchange_s,
CUtlMemory<CNetworkStringTableItem::itemchange_s, int> >::InsertBefore(int,
CNetworkStringTableItem::itemchange_s const&) */
int __thiscall
CUtlVector<CNetworkStringTableItem::itemchange_s,CUtlMemory<CNetworkStringTableItem::itemchange_s,int>>
::InsertBefore(CUtlVector<CNetworkStringTableItem::itemchange_s,CUtlMemory<CNetworkStringTableItem::itemchange_s,int>>
*this,int param_1,itemchange_s *param_2)
{
int iVar1;
undefined4 *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_001acda2;
if (iVar1 == 0) {
if (iVar4 == 0) {
if (iVar5 < 4) {
iVar4 = 3;
goto LAB_001ace06;
}
iVar4 = 3;
}
do {
iVar4 = iVar4 * 2;
} while (iVar4 < iVar5);
}
else {
for (iVar4 = iVar1 * (*(int *)(this + 0xc) / iVar1 + 1); iVar4 < iVar5;
iVar4 = (iVar4 + iVar5) / 2) {
}
}
LAB_001ace06:
*(int *)(this + 4) = iVar4;
if (*(void **)this != (void *)0x0) {
pvVar3 = realloc(*(void **)this,iVar4 * 0xc);
iVar5 = *(int *)(this + 0xc);
*(void **)this = pvVar3;
*(void **)(this + 0x10) = pvVar3;
*(int *)(this + 0xc) = iVar5 + 1;
iVar5 = (iVar5 + 1) - param_1;
goto joined_r0x001ace40;
}
pvVar3 = malloc(iVar4 * 0xc);
*(void **)this = pvVar3;
}
else {
LAB_001acda2:
pvVar3 = *(void **)this;
}
*(int *)(this + 0xc) = iVar5;
iVar5 = iVar5 - param_1;
*(void **)(this + 0x10) = pvVar3;
joined_r0x001ace40:
if (0 < iVar5 + -1) {
_V_memmove((void *)((int)pvVar3 + param_1 * 0xc + 0xc),(void *)((int)pvVar3 + param_1 * 0xc),
(iVar5 + -1) * 0xc);
pvVar3 = *(void **)this;
}
puVar2 = (undefined4 *)((int)pvVar3 + param_1 * 0xc);
if (puVar2 != (undefined4 *)0x0) {
*puVar2 = *(undefined4 *)param_2;
puVar2[1] = *(undefined4 *)(param_2 + 4);
puVar2[2] = *(undefined4 *)(param_2 + 8);
}
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.