CUtlVector<CRConServer::FailedRCon_t,CUtlMemory<CRConServer::FailedRCon_t,int>>::InsertBefore
0x0020c570 · 376 bytes · __thiscall
_ZN10CUtlVectorIN11CRConServer12FailedRCon_tE10CUtlMemoryIS1_iEE12InsertBeforeEi
Decompiled
undefined (2 params)
/* CUtlVector<CRConServer::FailedRCon_t, CUtlMemory<CRConServer::FailedRCon_t, int>
>::InsertBefore(int) */
int __thiscall
CUtlVector<CRConServer::FailedRCon_t,CUtlMemory<CRConServer::FailedRCon_t,int>>::InsertBefore
(CUtlVector<CRConServer::FailedRCon_t,CUtlMemory<CRConServer::FailedRCon_t,int>> *this,
int param_1)
{
netadr_s *this_00;
void *pvVar1;
int iVar2;
int iVar3;
int iVar4;
iVar4 = *(int *)(this + 4);
iVar3 = *(int *)(this + 0xc) + 1;
if (iVar4 < iVar3) {
iVar2 = *(int *)(this + 8);
if (-1 < iVar2) {
if (iVar2 == 0) {
if (iVar4 == 0) {
if (iVar3 < 2) {
iVar2 = 1;
goto LAB_0020c68f;
}
iVar4 = 1;
}
do {
iVar2 = iVar4 * 2;
if (iVar3 <= iVar2) break;
iVar2 = iVar4 * 4;
iVar4 = iVar2;
} while (iVar2 < iVar3);
}
else {
for (iVar2 = iVar2 * (*(int *)(this + 0xc) / iVar2 + 1); iVar2 < iVar3;
iVar2 = (iVar2 + iVar3) / 2) {
}
}
LAB_0020c68f:
*(int *)(this + 4) = iVar2;
if (*(void **)this == (void *)0x0) {
pvVar1 = malloc(iVar2 * 0x2c);
*(void **)this = pvVar1;
}
else {
pvVar1 = realloc(*(void **)this,iVar2 * 0x2c);
*(void **)this = pvVar1;
iVar3 = *(int *)(this + 0xc) + 1;
}
goto LAB_0020c592;
}
}
pvVar1 = *(void **)this;
LAB_0020c592:
*(int *)(this + 0xc) = iVar3;
iVar3 = (iVar3 - param_1) + -1;
*(void **)(this + 0x10) = pvVar1;
iVar4 = param_1 * 0x2c;
if (0 < iVar3) {
_V_memmove((void *)((int)pvVar1 + iVar4 + 0x2c),(void *)((int)pvVar1 + iVar4),iVar3 * 0x2c);
pvVar1 = *(void **)this;
}
pvVar1 = (void *)((int)pvVar1 + iVar4);
if (pvVar1 != (void *)0x0) {
this_00 = (netadr_s *)((int)pvVar1 + 4);
netadr_s::SetIP(this_00,0);
netadr_s::SetPort(this_00,0);
netadr_s::SetType(this_00,3);
*(undefined2 *)((int)pvVar1 + 0x26) = 0xffff;
*(undefined2 *)((int)pvVar1 + 0x22) = 0;
*(undefined4 *)((int)pvVar1 + 0x10) = 0;
*(undefined4 *)((int)pvVar1 + 0x14) = 0;
*(undefined4 *)((int)pvVar1 + 0x18) = 0;
*(undefined2 *)((int)pvVar1 + 0x1c) = 0xffff;
*(undefined2 *)((int)pvVar1 + 0x1e) = 0xffff;
*(undefined2 *)((int)pvVar1 + 0x20) = 0xffff;
*(undefined2 *)((int)pvVar1 + 0x24) = 0;
*(undefined4 *)((int)pvVar1 + 0x28) = 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.