CUtlVector<rr2::CriterionDynamic,CUtlMemoryConservative<rr2::CriterionDynamic>>::Sort
0x00bdae90 · 355 bytes · __thiscall
_ZN10CUtlVectorIN3rr216CriterionDynamicE22CUtlMemoryConservativeIS1_EE4SortEPFiPKS1_S6_E
Decompiled
undefined (2 params)
/* CUtlVector<rr2::CriterionDynamic, CUtlMemoryConservative<rr2::CriterionDynamic> >::Sort(int
(*)(rr2::CriterionDynamic const*, rr2::CriterionDynamic const*)) */
void __thiscall
CUtlVector<rr2::CriterionDynamic,CUtlMemoryConservative<rr2::CriterionDynamic>>::Sort
(CUtlVector<rr2::CriterionDynamic,CUtlMemoryConservative<rr2::CriterionDynamic>> *this,
_func_int_CriterionDynamic_ptr_CriterionDynamic_ptr *param_1)
{
undefined2 *puVar1;
int iVar2;
undefined4 uVar3;
byte bVar4;
undefined2 uVar5;
size_t __nmemb;
undefined4 uVar6;
undefined4 uVar7;
undefined4 uVar8;
int iVar9;
undefined2 *puVar10;
int iVar11;
int local_40;
__nmemb = *(size_t *)(this + 8);
if (1 < (int)__nmemb) {
if (*(void **)this == (void *)0x0) {
local_40 = __nmemb - 1;
do {
if (0 < local_40) {
iVar11 = 1;
do {
while( true ) {
iVar2 = iVar11 * 0x14;
iVar9 = (*param_1)((CriterionDynamic *)(*(int *)this + iVar2 + -0x14),
(CriterionDynamic *)(*(int *)this + iVar2));
if (-1 < iVar9) break;
iVar11 = iVar11 + 1;
puVar1 = (undefined2 *)(*(int *)this + iVar2);
puVar10 = (undefined2 *)(iVar2 + -0x14 + *(int *)this);
bVar4 = *(byte *)(puVar10 + 4);
uVar5 = *puVar10;
uVar3 = *(undefined4 *)(puVar10 + 2);
uVar6 = *(undefined4 *)(puVar10 + 6);
uVar7 = *(undefined4 *)(puVar10 + 8);
*puVar10 = *puVar1;
*(undefined4 *)(puVar10 + 2) = *(undefined4 *)(puVar1 + 2);
*(byte *)(puVar10 + 4) = bVar4 & 0xfe | *(byte *)(puVar1 + 4) & 1;
*(byte *)(puVar10 + 4) =
bVar4 & 0xfc | *(byte *)(puVar1 + 4) & 1 | *(byte *)(puVar1 + 4) & 2;
uVar8 = *(undefined4 *)(puVar1 + 8);
*(undefined4 *)(puVar10 + 6) = *(undefined4 *)(puVar1 + 6);
*(undefined4 *)(puVar10 + 8) = uVar8;
*(undefined4 *)(puVar1 + 2) = uVar3;
*puVar1 = uVar5;
*(byte *)(puVar1 + 4) = *(byte *)(puVar1 + 4) & 0xfc | bVar4 & 1 | bVar4 & 2;
*(undefined4 *)(puVar1 + 6) = uVar6;
*(undefined4 *)(puVar1 + 8) = uVar7;
if (local_40 < iVar11) goto LAB_00bdafe0;
}
iVar11 = iVar11 + 1;
} while (iVar11 <= local_40);
}
LAB_00bdafe0:
local_40 = local_40 + -1;
if (local_40 == -1) {
return;
}
} while( true );
}
qsort(*(void **)this,__nmemb,0x14,(__compar_fn_t)param_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.