CUtlLinkedList<CFoundryEntitySpawnRecord*,int,false,int,CUtlMemory<UtlLinkedListElem_t<CFoundryEntitySpawnRecord*,int>,int>>::InsertBefore
0x00681850 · 565 bytes · __thiscall
_ZN14CUtlLinkedListIP25CFoundryEntitySpawnRecordiLb0Ei10CUtlMemoryI19UtlLinkedListElem_tIS1_iEiEE12InsertBeforeEiRKS1_
Decompiled
undefined (3 params)
/* CUtlLinkedList<CFoundryEntitySpawnRecord*, int, false, int,
CUtlMemory<UtlLinkedListElem_t<CFoundryEntitySpawnRecord*, int>, int> >::InsertBefore(int,
CFoundryEntitySpawnRecord* const&) */
int __thiscall
CUtlLinkedList<CFoundryEntitySpawnRecord*,int,false,int,CUtlMemory<UtlLinkedListElem_t<CFoundryEntitySpawnRecord*,int>,int>>
::InsertBefore(CUtlLinkedList<CFoundryEntitySpawnRecord*,int,false,int,CUtlMemory<UtlLinkedListElem_t<CFoundryEntitySpawnRecord*,int>,int>>
*this,int param_1,CFoundryEntitySpawnRecord **param_2)
{
int iVar1;
int iVar2;
int iVar3;
void *pvVar4;
int iVar5;
int iVar6;
iVar5 = *(int *)(this + 0x14);
if (iVar5 != -1) {
iVar6 = iVar5 * 0xc;
iVar3 = *(int *)this + iVar6;
*(undefined4 *)(this + 0x14) = *(undefined4 *)(iVar3 + 8);
goto LAB_0068187b;
}
iVar3 = *(int *)(this + 0x20);
iVar6 = *(int *)(this + 4);
if ((iVar3 < 0) || (iVar6 <= iVar3)) {
iVar5 = 0;
if (iVar6 < 1) goto LAB_00681916;
}
else {
iVar5 = iVar3 + 1;
if ((iVar5 < 0) || (iVar6 <= iVar5)) {
LAB_00681916:
iVar5 = *(int *)(this + 8);
if (iVar5 < 0) {
pvVar4 = *(void **)this;
}
else {
iVar2 = iVar6 + 1;
if (iVar5 == 0) {
iVar5 = 3;
if (iVar6 != 0) {
iVar5 = iVar6;
}
while (iVar6 = iVar5, iVar6 < iVar2) {
iVar5 = iVar6 * 2;
}
}
else {
for (iVar6 = iVar5 * (iVar6 / iVar5 + 1); iVar6 < iVar2; iVar6 = (iVar6 + iVar2) / 2) {
}
}
*(int *)(this + 4) = iVar6;
if (*(void **)this == (void *)0x0) {
pvVar4 = malloc(iVar6 * 0xc);
*(void **)this = pvVar4;
}
else {
pvVar4 = realloc(*(void **)this,iVar6 * 0xc);
iVar3 = *(int *)(this + 0x20);
iVar6 = *(int *)(this + 4);
*(void **)this = pvVar4;
}
}
*(void **)(this + 0x24) = pvVar4;
if ((iVar3 < 0) || (iVar6 <= iVar3)) {
iVar5 = 0;
if (iVar6 < 1) goto LAB_0068199e;
goto LAB_006819ea;
}
iVar5 = iVar3 + 1;
if ((iVar5 < 0) || (iVar6 <= iVar5)) {
LAB_0068199e:
if (AllocInternal(bool)::__executeCount < 10) {
AllocInternal(bool)::__executeCount = AllocInternal(bool)::__executeCount + 1;
Warning("CUtlLinkedList overflow! (exhausted memory allocator)\n");
}
return -1;
}
}
if (iVar5 == -1) {
if (9 < AllocInternal(bool)::__executeCount) {
return -1;
}
AllocInternal(bool)::__executeCount = AllocInternal(bool)::__executeCount + 1;
Warning("CUtlLinkedList overflow! (exhausted index range)\n");
return -1;
}
}
LAB_006819ea:
*(int *)(this + 0x20) = iVar5;
*(int *)(this + 0x1c) = *(int *)(this + 0x1c) + 1;
iVar6 = iVar5 * 0xc;
iVar3 = *(int *)this + iVar6;
LAB_0068187b:
*(int *)(iVar3 + 8) = iVar5;
*(int *)(*(int *)this + 4 + iVar6) = iVar5;
Unlink(this,iVar5);
iVar3 = *(int *)this + iVar6;
*(int *)(iVar3 + 8) = param_1;
if (param_1 == -1) {
iVar2 = *(int *)(this + 0x10);
*(int *)(iVar3 + 4) = iVar2;
*(int *)(this + 0x10) = iVar5;
}
else {
iVar1 = *(int *)this + param_1 * 0xc;
iVar2 = *(int *)(iVar1 + 4);
*(int *)(iVar3 + 4) = iVar2;
*(int *)(iVar1 + 4) = iVar5;
}
if (iVar2 == -1) {
*(int *)(this + 0xc) = iVar5;
}
else {
*(int *)(*(int *)this + iVar2 * 0xc + 8) = iVar5;
}
*(int *)(this + 0x18) = *(int *)(this + 0x18) + 1;
if ((undefined4 *)(iVar6 + *(int *)this) != (undefined4 *)0x0) {
*(undefined4 *)(iVar6 + *(int *)this) = *param_2;
}
return iVar5;
}
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.