CUtlPriorityQueue<CEventRegister*,CDefUtlPriorityQueueLessFunc<CEventRegister*>,CUtlMemory<CEventRegister*,int>>::Insert
0x00b08540 · 335 bytes · __thiscall
_ZN17CUtlPriorityQueueIP14CEventRegister28CDefUtlPriorityQueueLessFuncIS1_E10CUtlMemoryIS1_iEE6InsertERKS1_
Decompiled
undefined (2 params)
/* CUtlPriorityQueue<CEventRegister*, CDefUtlPriorityQueueLessFunc<CEventRegister*>,
CUtlMemory<CEventRegister*, int> >::Insert(CEventRegister* const&) */
void __thiscall
CUtlPriorityQueue<CEventRegister*,CDefUtlPriorityQueueLessFunc<CEventRegister*>,CUtlMemory<CEventRegister*,int>>
::Insert(CUtlPriorityQueue<CEventRegister*,CDefUtlPriorityQueueLessFunc<CEventRegister*>,CUtlMemory<CEventRegister*,int>>
*this,CEventRegister **param_1)
{
int iVar1;
undefined4 uVar2;
int iVar3;
char cVar4;
void *pvVar5;
int iVar6;
int iVar7;
undefined4 *puVar8;
int iVar9;
iVar1 = *(int *)(this + 0xc);
iVar6 = *(int *)(this + 4);
iVar9 = iVar1 + 1;
iVar7 = iVar9;
if (iVar6 < iVar9) {
iVar3 = *(int *)(this + 8);
if (-1 < iVar3) {
if (iVar3 == 0) {
if (iVar6 == 0) {
if (iVar9 < 9) {
iVar6 = 8;
goto LAB_00b0862e;
}
iVar6 = 8;
}
do {
iVar6 = iVar6 * 2;
} while (iVar6 < iVar9);
}
else {
for (iVar6 = (iVar1 / iVar3 + 1) * iVar3; iVar6 < iVar9; iVar6 = (iVar6 + iVar9) / 2) {
}
}
LAB_00b0862e:
*(int *)(this + 4) = iVar6;
if (*(void **)this == (void *)0x0) {
pvVar5 = malloc(iVar6 << 2);
*(void **)this = pvVar5;
}
else {
pvVar5 = realloc(*(void **)this,iVar6 << 2);
*(void **)this = pvVar5;
iVar7 = *(int *)(this + 0xc) + 1;
}
goto LAB_00b08561;
}
}
pvVar5 = *(void **)this;
LAB_00b08561:
*(int *)(this + 0xc) = iVar7;
*(void **)(this + 0x10) = pvVar5;
iVar6 = iVar1 * 4;
iVar7 = (iVar7 - iVar1) + -1;
if (0 < iVar7) {
_V_memmove((void *)((int)pvVar5 + iVar6 + 4),(void *)((int)pvVar5 + iVar6),iVar7 * 4);
pvVar5 = *(void **)this;
}
*(CEventRegister **)((int)pvVar5 + iVar6) = *param_1;
while( true ) {
if (iVar1 == 0) {
return;
}
iVar9 = iVar9 / 2;
iVar6 = (iVar9 + -1) * 4;
cVar4 = (**(code **)(this + 0x14))(*(int *)this + iVar1 * 4,*(int *)this + iVar6);
if (cVar4 != '\0') break;
puVar8 = (undefined4 *)(iVar6 + *(int *)this);
uVar2 = *puVar8;
*puVar8 = *(undefined4 *)(*(int *)this + iVar1 * 4);
*(undefined4 *)(*(int *)this + iVar1 * 4) = uVar2;
iVar1 = iVar9 + -1;
}
return;
}
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.