CUtlPriorityQueue<UGCFileRequest_t*,CDefUtlPriorityQueueLessFunc<UGCFileRequest_t*>,CUtlMemory<UGCFileRequest_t*,int>>::Insert
0x00223a00 · 337 bytes · __thiscall
_ZN17CUtlPriorityQueueIP16UGCFileRequest_t28CDefUtlPriorityQueueLessFuncIS1_E10CUtlMemoryIS1_iEE6InsertERKS1_
Decompiled
undefined (2 params)
/* CUtlPriorityQueue<UGCFileRequest_t*, CDefUtlPriorityQueueLessFunc<UGCFileRequest_t*>,
CUtlMemory<UGCFileRequest_t*, int> >::Insert(UGCFileRequest_t* const&) */
void __thiscall
CUtlPriorityQueue<UGCFileRequest_t*,CDefUtlPriorityQueueLessFunc<UGCFileRequest_t*>,CUtlMemory<UGCFileRequest_t*,int>>
::Insert(CUtlPriorityQueue<UGCFileRequest_t*,CDefUtlPriorityQueueLessFunc<UGCFileRequest_t*>,CUtlMemory<UGCFileRequest_t*,int>>
*this,UGCFileRequest_t **param_1)
{
int iVar1;
undefined4 uVar2;
char cVar3;
int iVar4;
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) {
iVar4 = *(int *)(this + 8);
if (-1 < iVar4) {
if (iVar4 == 0) {
if (iVar6 == 0) {
if (iVar9 < 9) {
iVar4 = 8;
goto LAB_00223aff;
}
iVar6 = 8;
}
do {
iVar4 = iVar6 * 2;
if (iVar9 <= iVar4) break;
iVar4 = iVar6 * 4;
iVar6 = iVar4;
} while (iVar4 < iVar9);
}
else {
for (iVar4 = (iVar1 / iVar4 + 1) * iVar4; iVar4 < iVar9; iVar4 = (iVar4 + iVar9) / 2) {
}
}
LAB_00223aff:
*(int *)(this + 4) = iVar4;
if (*(void **)this == (void *)0x0) {
pvVar5 = malloc(iVar4 << 2);
*(void **)this = pvVar5;
}
else {
pvVar5 = realloc(*(void **)this,iVar4 << 2);
*(void **)this = pvVar5;
iVar7 = *(int *)(this + 0xc) + 1;
}
goto LAB_00223a21;
}
}
pvVar5 = *(void **)this;
LAB_00223a21:
*(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;
}
*(UGCFileRequest_t **)((int)pvVar5 + iVar6) = *param_1;
while( true ) {
if (iVar1 == 0) {
return;
}
iVar9 = iVar9 / 2;
iVar6 = (iVar9 + -1) * 4;
cVar3 = (**(code **)(this + 0x14))(*(int *)this + iVar1 * 4,*(int *)this + iVar6);
if (cVar3 != '\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.