GCSDK::CJobMgr::ListJobs
0x000616d0 · 1752 bytes · __thiscall
_ZN5GCSDK7CJobMgr8ListJobsEi
Decompiled
undefined (2 params)
/* GCSDK::CJobMgr::ListJobs(int) */
int __thiscall GCSDK::CJobMgr::ListJobs(CJobMgr *this,int param_1)
{
uint *puVar1;
uint uVar2;
CJob *this_00;
undefined4 uVar3;
undefined4 uVar4;
bool bVar5;
undefined4 uVar6;
char *pcVar7;
int iVar8;
int iVar9;
int iVar10;
int iVar11;
undefined4 *puVar12;
undefined4 *puVar13;
int in_GS_OFFSET;
byte bVar14;
undefined8 uVar15;
undefined4 uVar16;
undefined4 uVar17;
undefined4 uVar18;
undefined4 uVar19;
undefined4 uVar20;
undefined4 uVar21;
undefined4 uVar22;
undefined4 uVar23;
undefined4 uVar24;
undefined4 uVar25;
undefined4 uVar26;
undefined4 uVar27;
undefined4 uVar28;
int local_230;
int local_224;
int local_210 [5];
code *local_1fc;
int local_1f8;
int local_1f4;
undefined4 local_1f0;
undefined4 local_1ec;
int local_1e8;
int local_1e4;
int local_1e0;
undefined4 local_1dc;
undefined4 local_1d8;
undefined4 local_1d4 [54];
undefined4 local_fc;
undefined4 local_f8 [54];
int local_20;
bVar14 = 0;
local_1fc = CDefOps<unsigned_int>::LessFunc;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
local_1f8 = 0;
local_1f4 = 0;
local_1f0 = 0;
local_1ec = 0xffffffff;
local_1e8 = 0;
local_1e4 = -1;
local_1e0 = -1;
local_1dc = 0;
if (*(int *)(this + 8) < 1) {
local_230 = 0;
}
else {
local_224 = 0;
iVar10 = 0;
local_230 = 0;
do {
if (iVar10 <= *(int *)(this + 0x1c)) {
if ((CUtlRBTree<CUtlMap<unsigned_long_long,GCSDK::CJob*,int>::Node_t,int,CUtlMap<unsigned_long_long,GCSDK::CJob*,int>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_long_long,GCSDK::CJob*,int>::Node_t,int>,int>>
::Links(int)::s_Sentinel == '\0') &&
(iVar9 = __cxa_guard_acquire(&CUtlRBTree<CUtlMap<unsigned_long_long,GCSDK::CJob*,int>::Node_t,int,CUtlMap<unsigned_long_long,GCSDK::CJob*,int>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_long_long,GCSDK::CJob*,int>::Node_t,int>,int>>
::Links(int)::s_Sentinel), iVar9 != 0)) {
CUtlRBTree<CUtlMap<unsigned_long_long,GCSDK::CJob*,int>::Node_t,int,CUtlMap<unsigned_long_long,GCSDK::CJob*,int>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_long_long,GCSDK::CJob*,int>::Node_t,int>,int>>
::Links(int)::s_Sentinel = 0xffffffff;
DAT_000d282c = 0xffffffff;
DAT_000d2830 = 0xffffffff;
__cxa_guard_release(&CUtlRBTree<CUtlMap<unsigned_long_long,GCSDK::CJob*,int>::Node_t,int,CUtlMap<unsigned_long_long,GCSDK::CJob*,int>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_long_long,GCSDK::CJob*,int>::Node_t,int>,int>>
::Links(int)::s_Sentinel);
}
if (*(int *)(*(int *)(this + 4) + local_224) != iVar10) {
this_00 = *(CJob **)(*(int *)(this + 4) + 0x18 + local_224);
/* try { // try from 000617ce to 00061a55 has its CatchHandler @ 00061e31 */
uVar6 = CJob::GetName(this_00);
puVar12 = local_1d4;
for (iVar9 = 0x36; iVar9 != 0; iVar9 = iVar9 + -1) {
*puVar12 = 0;
puVar12 = puVar12 + (uint)bVar14 * -2 + 1;
}
local_1d8 = uVar6;
iVar9 = CUtlRBTree<CUtlMap<unsigned_int,GCSDK::JobStatsBucket_t,int>::Node_t,int,CUtlMap<unsigned_int,GCSDK::JobStatsBucket_t,int>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_int,GCSDK::JobStatsBucket_t,int>::Node_t,int>,int>>
::Find((CUtlRBTree<CUtlMap<unsigned_int,GCSDK::JobStatsBucket_t,int>::Node_t,int,CUtlMap<unsigned_int,GCSDK::JobStatsBucket_t,int>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_int,GCSDK::JobStatsBucket_t,int>::Node_t,int>,int>>
*)&local_1fc,(Node_t *)&local_1d8);
if (iVar9 == -1) {
puVar12 = &local_1d8;
for (iVar9 = 0x36; iVar9 != 0; iVar9 = iVar9 + -1) {
*puVar12 = 0;
puVar12 = puVar12 + (uint)bVar14 * -2 + 1;
}
pcVar7 = (char *)CJob::GetName(this_00);
V_strncpy((char *)&local_1d8,pcVar7,0x40);
local_fc = uVar6;
puVar12 = local_f8;
for (iVar9 = 0x36; iVar9 != 0; iVar9 = iVar9 + -1) {
*puVar12 = 0;
puVar12 = puVar12 + (uint)bVar14 * -2 + 1;
}
puVar12 = &local_1d8;
puVar13 = local_f8;
for (iVar9 = 0x36; iVar9 != 0; iVar9 = iVar9 + -1) {
*puVar13 = *puVar12;
puVar12 = puVar12 + (uint)bVar14 * -2 + 1;
puVar13 = puVar13 + (uint)bVar14 * -2 + 1;
}
iVar9 = CUtlRBTree<CUtlMap<unsigned_int,GCSDK::JobStatsBucket_t,int>::Node_t,int,CUtlMap<unsigned_int,GCSDK::JobStatsBucket_t,int>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_int,GCSDK::JobStatsBucket_t,int>::Node_t,int>,int>>
::Insert((CUtlRBTree<CUtlMap<unsigned_int,GCSDK::JobStatsBucket_t,int>::Node_t,int,CUtlMap<unsigned_int,GCSDK::JobStatsBucket_t,int>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_int,GCSDK::JobStatsBucket_t,int>::Node_t,int>,int>>
*)&local_1fc,(Node_t *)&local_fc);
}
iVar11 = iVar9 * 0xec + local_1f8;
puVar1 = (uint *)(iVar11 + 0x54);
uVar2 = *puVar1;
*puVar1 = *puVar1 + 1;
*(int *)(iVar11 + 0x58) = *(int *)(iVar11 + 0x58) + (uint)(0xfffffffe < uVar2);
iVar9 = *(int *)(this_00 + 0x54);
puVar1 = (uint *)(iVar11 + 0x74);
uVar2 = *puVar1;
*puVar1 = *puVar1 + (uint)(iVar9 != 0);
*(int *)(iVar11 + 0x78) = *(int *)(iVar11 + 0x78) + (uint)CARRY4(uVar2,(uint)(iVar9 != 0))
;
iVar9 = *(int *)(this_00 + 0x58);
puVar1 = (uint *)(iVar11 + 0x7c);
uVar2 = *puVar1;
*puVar1 = *puVar1 + (uint)(iVar9 != 0);
*(int *)(iVar11 + 0x80) = *(int *)(iVar11 + 0x80) + (uint)CARRY4(uVar2,(uint)(iVar9 != 0))
;
switch(*(undefined4 *)(this_00 + 0x24)) {
case 2:
puVar1 = (uint *)(iVar11 + 0xc4);
uVar2 = *puVar1;
*puVar1 = *puVar1 + 1;
*(int *)(iVar11 + 200) = *(int *)(iVar11 + 200) + (uint)(0xfffffffe < uVar2);
break;
case 3:
puVar1 = (uint *)(iVar11 + 0xcc);
uVar2 = *puVar1;
*puVar1 = *puVar1 + 1;
*(int *)(iVar11 + 0xd0) = *(int *)(iVar11 + 0xd0) + (uint)(0xfffffffe < uVar2);
break;
case 4:
puVar1 = (uint *)(iVar11 + 0xd4);
uVar2 = *puVar1;
*puVar1 = *puVar1 + 1;
*(int *)(iVar11 + 0xd8) = *(int *)(iVar11 + 0xd8) + (uint)(0xfffffffe < uVar2);
break;
case 5:
puVar1 = (uint *)(iVar11 + 0xdc);
uVar2 = *puVar1;
*puVar1 = *puVar1 + 1;
*(int *)(iVar11 + 0xe0) = *(int *)(iVar11 + 0xe0) + (uint)(0xfffffffe < uVar2);
break;
case 6:
puVar1 = (uint *)(iVar11 + 0xe4);
uVar2 = *puVar1;
*puVar1 = *puVar1 + 1;
*(int *)(iVar11 + 0xe8) = *(int *)(iVar11 + 0xe8) + (uint)(0xfffffffe < uVar2);
}
uVar15 = CJobTime::CServerMicroSecsPassed((CJobTime *)(this_00 + 0x28));
puVar1 = (uint *)(iVar11 + 0xa4);
uVar2 = *puVar1;
*puVar1 = *puVar1 + (uint)uVar15;
*(int *)(iVar11 + 0xa8) =
*(int *)(iVar11 + 0xa8) + (int)((ulonglong)uVar15 >> 0x20) +
(uint)CARRY4(uVar2,(uint)uVar15);
if (*(int *)(this_00 + 0x2c) != *(int *)(this_00 + 0x34) ||
*(int *)(this_00 + 0x28) != *(int *)(this_00 + 0x30)) {
puVar1 = (uint *)(iVar11 + 0xac);
uVar2 = *puVar1;
*puVar1 = *puVar1 + 1;
*(int *)(iVar11 + 0xb0) = *(int *)(iVar11 + 0xb0) + (uint)(0xfffffffe < uVar2);
}
local_230 = local_230 + 1;
}
}
iVar10 = iVar10 + 1;
local_224 = local_224 + 0x1c;
} while (iVar10 < *(int *)(this + 8));
}
EmitInfo("console",param_1,3,
"%50s --- running jobs (usec)--- holding --- waiting---- pause reasons----------------------------------------\n"
,&DAT_000b4ca6);
EmitInfo("console",param_1,3,
"%50s count duration lock for lock netmsg sleep waitlock yield workitem\n"
,"name");
local_210[0] = 0;
local_210[1] = 0;
local_210[2] = 0;
local_210[3] = 0;
local_210[4] = 0;
/* try { // try from 00061a9b to 00061c13 has its CatchHandler @ 00061ddb */
CUtlVector<int,CUtlMemory<int,int>>::EnsureCount
((CUtlVector<int,CUtlMemory<int,int>> *)local_210,local_1e8);
iVar9 = 0;
iVar10 = 0;
iVar11 = 0;
if (0 < local_1f4) {
do {
if (iVar10 <= local_1e0) {
if ((CUtlRBTree<CUtlMap<unsigned_int,GCSDK::JobStatsBucket_t,int>::Node_t,int,CUtlMap<unsigned_int,GCSDK::JobStatsBucket_t,int>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_int,GCSDK::JobStatsBucket_t,int>::Node_t,int>,int>>
::Links(int)::s_Sentinel == '\0') &&
(iVar8 = __cxa_guard_acquire(&CUtlRBTree<CUtlMap<unsigned_int,GCSDK::JobStatsBucket_t,int>::Node_t,int,CUtlMap<unsigned_int,GCSDK::JobStatsBucket_t,int>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_int,GCSDK::JobStatsBucket_t,int>::Node_t,int>,int>>
::Links(int)::s_Sentinel), iVar8 != 0)) {
CUtlRBTree<CUtlMap<unsigned_int,GCSDK::JobStatsBucket_t,int>::Node_t,int,CUtlMap<unsigned_int,GCSDK::JobStatsBucket_t,int>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_int,GCSDK::JobStatsBucket_t,int>::Node_t,int>,int>>
::Links(int)::s_Sentinel = 0xffffffff;
DAT_000d2844 = 0xffffffff;
DAT_000d2848 = 0xffffffff;
__cxa_guard_release(&CUtlRBTree<CUtlMap<unsigned_int,GCSDK::JobStatsBucket_t,int>::Node_t,int,CUtlMap<unsigned_int,GCSDK::JobStatsBucket_t,int>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_int,GCSDK::JobStatsBucket_t,int>::Node_t,int>,int>>
::Links(int)::s_Sentinel);
}
if (*(int *)(local_1f8 + iVar9) != iVar10) {
*(int *)(local_210[0] + iVar11 * 4) = iVar10;
iVar11 = iVar11 + 1;
}
}
iVar10 = iVar10 + 1;
iVar9 = iVar9 + 0xec;
} while (iVar10 < local_1f4);
}
iVar10 = 0;
if (0 < local_210[3]) {
do {
iVar9 = *(int *)(local_210[0] + iVar10 * 4) * 0xec + local_1f8;
uVar6 = *(undefined4 *)(iVar9 + 0xe4);
uVar28 = *(undefined4 *)(iVar9 + 0xe8);
uVar3 = *(undefined4 *)(iVar9 + 0x58);
uVar4 = *(undefined4 *)(iVar9 + 0x54);
uVar26 = *(undefined4 *)(iVar9 + 0xdc);
uVar27 = *(undefined4 *)(iVar9 + 0xe0);
uVar24 = *(undefined4 *)(iVar9 + 0xd4);
uVar25 = *(undefined4 *)(iVar9 + 0xd8);
uVar22 = *(undefined4 *)(iVar9 + 0xcc);
uVar23 = *(undefined4 *)(iVar9 + 0xd0);
uVar20 = *(undefined4 *)(iVar9 + 0xc4);
uVar21 = *(undefined4 *)(iVar9 + 200);
uVar18 = *(undefined4 *)(iVar9 + 0x7c);
uVar19 = *(undefined4 *)(iVar9 + 0x80);
uVar16 = *(undefined4 *)(iVar9 + 0x74);
uVar17 = *(undefined4 *)(iVar9 + 0x78);
uVar15 = __udivdi3(*(undefined4 *)(iVar9 + 0xa4),*(undefined4 *)(iVar9 + 0xa8),uVar4,uVar3);
EmitInfo("console",param_1,3,
"%50s %12lld %12lld %12lld %12lld %8lld %8lld %8lld %8lld %8lld \n",iVar9 + 0x14,
uVar4,uVar3,(int)uVar15,(int)((ulonglong)uVar15 >> 0x20),uVar16,uVar17,uVar18,uVar19,
uVar20,uVar21,uVar22,uVar23,uVar24,uVar25,uVar26,uVar27,uVar6,uVar28);
iVar10 = iVar10 + 1;
} while (iVar10 < local_210[3]);
}
local_210[3] = 0;
CUtlMemory<int,int>::Purge((CUtlMemory<int,int> *)local_210);
local_210[4] = local_210[0];
CUtlMemory<int,int>::Purge((CUtlMemory<int,int> *)local_210);
if (local_1e0 != -1) {
iVar11 = 0;
iVar10 = local_1e0;
iVar9 = 0;
if (0 < local_1f4) {
do {
if (((-1 < iVar9) && (iVar9 < local_1f4)) && (iVar9 <= iVar10)) {
if ((CUtlRBTree<CUtlMap<unsigned_int,GCSDK::JobStatsBucket_t,int>::Node_t,int,CUtlMap<unsigned_int,GCSDK::JobStatsBucket_t,int>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_int,GCSDK::JobStatsBucket_t,int>::Node_t,int>,int>>
::Links(int)::s_Sentinel == '\0') &&
(iVar10 = __cxa_guard_acquire(&CUtlRBTree<CUtlMap<unsigned_int,GCSDK::JobStatsBucket_t,int>::Node_t,int,CUtlMap<unsigned_int,GCSDK::JobStatsBucket_t,int>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_int,GCSDK::JobStatsBucket_t,int>::Node_t,int>,int>>
::Links(int)::s_Sentinel), iVar10 != 0)) {
CUtlRBTree<CUtlMap<unsigned_int,GCSDK::JobStatsBucket_t,int>::Node_t,int,CUtlMap<unsigned_int,GCSDK::JobStatsBucket_t,int>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_int,GCSDK::JobStatsBucket_t,int>::Node_t,int>,int>>
::Links(int)::s_Sentinel = 0xffffffff;
DAT_000d2844 = 0xffffffff;
DAT_000d2848 = 0xffffffff;
__cxa_guard_release(&CUtlRBTree<CUtlMap<unsigned_int,GCSDK::JobStatsBucket_t,int>::Node_t,int,CUtlMap<unsigned_int,GCSDK::JobStatsBucket_t,int>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_int,GCSDK::JobStatsBucket_t,int>::Node_t,int>,int>>
::Links(int)::s_Sentinel);
}
iVar10 = local_1e0;
if (iVar9 != *(int *)(local_1f8 + iVar11)) {
((int *)(local_1f8 + iVar11))[1] = local_1e4;
*(int *)(local_1f8 + iVar11) = iVar9;
local_1e4 = iVar9;
}
}
} while (((iVar10 != iVar9) && (iVar9 + 1 < local_1f4)) &&
(iVar11 = iVar11 + 0xec, bVar5 = -2 < iVar9, iVar9 = iVar9 + 1, bVar5));
}
local_1ec = 0xffffffff;
local_1e8 = 0;
}
local_1e4 = 0xffffffff;
CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_int,GCSDK::JobStatsBucket_t,int>::Node_t,int>,int>::
Purge((CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_int,GCSDK::JobStatsBucket_t,int>::Node_t,int>,int>
*)&local_1f8);
local_1e0 = 0xffffffff;
CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_int,GCSDK::JobStatsBucket_t,int>::Node_t,int>,int>::
Purge((CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_int,GCSDK::JobStatsBucket_t,int>::Node_t,int>,int>
*)&local_1f8);
if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
return local_230;
}
/* WARNING: Subroutine does not return */
__stack_chk_fail();
}
SourceMod gamedata
paste intoaddons/sourcemod/gamedata/<your_plugin>.txt
used as the SourceMod key — change to fit your plugin's convention
SourceMod library name (server / engine / matchmaking)
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.
Gamedata KeyValues
DHooks plugin example
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.