CUtlVector<rr2::CriterionLambda,CUtlMemoryConservative<rr2::CriterionLambda>>::Sort
0x00bdb000 · 462 bytes · __thiscall
_ZN10CUtlVectorIN3rr215CriterionLambdaE22CUtlMemoryConservativeIS1_EE4SortEPFiPKS1_S6_E
Decompiled
undefined (2 params)
/* WARNING: Removing unreachable block (ram,0x00bdb0ca) */
/* WARNING: Removing unreachable block (ram,0x00bdb180) */
/* WARNING: Removing unreachable block (ram,0x00bdb196) */
/* CUtlVector<rr2::CriterionLambda, CUtlMemoryConservative<rr2::CriterionLambda> >::Sort(int
(*)(rr2::CriterionLambda const*, rr2::CriterionLambda const*)) */
void __thiscall
CUtlVector<rr2::CriterionLambda,CUtlMemoryConservative<rr2::CriterionLambda>>::Sort
(CUtlVector<rr2::CriterionLambda,CUtlMemoryConservative<rr2::CriterionLambda>> *this,
_func_int_CriterionLambda_ptr_CriterionLambda_ptr *param_1)
{
int *piVar1;
int iVar2;
size_t __nmemb;
int *piVar3;
char cVar4;
int iVar5;
undefined2 *puVar6;
int iVar7;
undefined2 *puVar8;
int *piVar9;
int local_34;
undefined2 local_28 [2];
undefined4 local_24;
int *local_20;
__nmemb = *(size_t *)(this + 8);
if (1 < (int)__nmemb) {
if (*(void **)this == (void *)0x0) {
local_34 = __nmemb - 1;
do {
if (0 < local_34) {
iVar7 = 1;
do {
while( true ) {
iVar2 = iVar7 * 0xc;
iVar5 = (*param_1)((CriterionLambda *)(*(int *)this + iVar2 + -0xc),
(CriterionLambda *)(*(int *)this + iVar2));
if (-1 < iVar5) break;
puVar8 = (undefined2 *)(iVar2 + *(int *)this);
puVar6 = (undefined2 *)(*(int *)this + iVar2 + -0xc);
local_28[0] = *puVar6;
local_20 = (int *)0x0;
piVar3 = *(int **)(puVar6 + 4);
if (piVar3 != (int *)0x0) {
LOCK();
piVar3[1] = piVar3[1] + 1;
UNLOCK();
local_20 = piVar3;
}
local_24 = 0x3f800000;
if (puVar8 != puVar6) {
piVar3 = *(int **)(puVar8 + 4);
piVar9 = *(int **)(puVar6 + 4);
if (piVar3 != piVar9) {
if (piVar3 != (int *)0x0) {
LOCK();
piVar3[1] = piVar3[1] + 1;
UNLOCK();
piVar9 = *(int **)(puVar6 + 4);
}
if (piVar9 != (int *)0x0) {
LOCK();
piVar1 = piVar9 + 1;
*piVar1 = *piVar1 + -1;
UNLOCK();
if ((*piVar1 == 0) &&
(cVar4 = (**(code **)(*piVar9 + 8))(piVar9), cVar4 != '\0')) {
(**(code **)(*piVar9 + 4))(piVar9);
}
}
*(int **)(puVar6 + 4) = piVar3;
}
}
piVar3 = local_20;
if ((puVar8 != local_28) && (piVar9 = *(int **)(puVar8 + 4), local_20 != piVar9)) {
if (local_20 != (int *)0x0) {
LOCK();
local_20[1] = local_20[1] + 1;
UNLOCK();
piVar9 = *(int **)(puVar8 + 4);
}
if (piVar9 != (int *)0x0) {
LOCK();
piVar1 = piVar9 + 1;
*piVar1 = *piVar1 + -1;
UNLOCK();
/* try { // try from 00bdb1ad to 00bdb1c7 has its CatchHandler @ 00bdb1dd */
if ((*piVar1 == 0) && (cVar4 = (**(code **)(*piVar9 + 8))(piVar9), cVar4 != '\0'))
{
(**(code **)(*piVar9 + 4))(piVar9);
}
}
*(int **)(puVar8 + 4) = piVar3;
}
iVar7 = iVar7 + 1;
rr2::CriterionLambda::~CriterionLambda((CriterionLambda *)local_28);
if (local_34 < iVar7) goto LAB_00bdb168;
}
iVar7 = iVar7 + 1;
} while (iVar7 <= local_34);
}
LAB_00bdb168:
local_34 = local_34 + -1;
if (local_34 == -1) {
return;
}
} while( true );
}
qsort(*(void **)this,__nmemb,0xc,(__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.