CUtlVector<rr2::CriterionStatic,CUtlMemoryConservative<rr2::CriterionStatic>>::Sort
0x00bdad10 · 379 bytes · __thiscall
_ZN10CUtlVectorIN3rr215CriterionStaticE22CUtlMemoryConservativeIS1_EE4SortEPFiPKS1_S6_E
Decompiled
undefined (2 params)
/* CUtlVector<rr2::CriterionStatic, CUtlMemoryConservative<rr2::CriterionStatic> >::Sort(int
(*)(rr2::CriterionStatic const*, rr2::CriterionStatic const*)) */
void __thiscall
CUtlVector<rr2::CriterionStatic,CUtlMemoryConservative<rr2::CriterionStatic>>::Sort
(CUtlVector<rr2::CriterionStatic,CUtlMemoryConservative<rr2::CriterionStatic>> *this,
_func_int_CriterionStatic_ptr_CriterionStatic_ptr *param_1)
{
undefined2 *puVar1;
int iVar2;
undefined4 uVar3;
byte bVar4;
undefined2 uVar5;
size_t __nmemb;
undefined4 uVar6;
undefined4 uVar7;
undefined4 uVar8;
int iVar9;
byte bVar10;
undefined2 *puVar11;
int iVar12;
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) {
iVar12 = 1;
do {
while( true ) {
iVar2 = iVar12 * 0x14;
iVar9 = (*param_1)((CriterionStatic *)(*(int *)this + iVar2 + -0x14),
(CriterionStatic *)(*(int *)this + iVar2));
if (-1 < iVar9) break;
iVar12 = iVar12 + 1;
puVar1 = (undefined2 *)(*(int *)this + iVar2);
puVar11 = (undefined2 *)(iVar2 + -0x14 + *(int *)this);
bVar4 = *(byte *)(puVar11 + 4);
uVar5 = *puVar11;
uVar3 = *(undefined4 *)(puVar11 + 2);
uVar6 = *(undefined4 *)(puVar11 + 6);
uVar7 = *(undefined4 *)(puVar11 + 8);
*puVar11 = *puVar1;
*(undefined4 *)(puVar11 + 2) = *(undefined4 *)(puVar1 + 2);
bVar10 = *(byte *)(puVar1 + 4) & 1;
*(byte *)(puVar11 + 4) = bVar4 & 0xfe | bVar10;
*(byte *)(puVar11 + 4) = bVar4 & 0xfc | bVar10 | *(byte *)(puVar1 + 4) & 2;
*(byte *)(puVar11 + 4) =
bVar4 & 0xf8 | bVar10 | *(byte *)(puVar1 + 4) & 2 | *(byte *)(puVar1 + 4) & 4;
uVar8 = *(undefined4 *)(puVar1 + 8);
*(undefined4 *)(puVar11 + 6) = *(undefined4 *)(puVar1 + 6);
*(undefined4 *)(puVar11 + 8) = uVar8;
*(undefined4 *)(puVar1 + 2) = uVar3;
*puVar1 = uVar5;
*(byte *)(puVar1 + 4) =
*(byte *)(puVar1 + 4) & 0xf8 | bVar4 & 1 | bVar4 & 2 | bVar4 & 4;
*(undefined4 *)(puVar1 + 6) = uVar6;
*(undefined4 *)(puVar1 + 8) = uVar7;
if (local_40 < iVar12) goto LAB_00bdae78;
}
iVar12 = iVar12 + 1;
} while (iVar12 <= local_40);
}
LAB_00bdae78:
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.