CDataManagerBase::FlushAllUnlocked
0x00249f40 · 335 bytes · __thiscall
_ZN16CDataManagerBase16FlushAllUnlockedEv
Decompiled
undefined (1 param)
/* CDataManagerBase::FlushAllUnlocked() */
int __thiscall CDataManagerBase::FlushAllUnlocked(CDataManagerBase *this)
{
ushort *puVar1;
code *pcVar2;
int iVar3;
undefined4 uVar4;
int iVar5;
CDataManagerBase *pCVar6;
uint uVar7;
uint uVar8;
int iVar9;
uint uVar10;
int in_GS_OFFSET;
CDataManagerBase *apCStack_60 [2];
uint uStack_58;
uint uStack_54;
undefined1 auStack_50 [8];
int local_48;
uint local_44;
CDataManagerBase *local_40;
undefined4 local_38;
undefined1 *local_34;
uint local_30;
undefined4 local_2c;
undefined4 local_28;
undefined1 *local_24;
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
apCStack_60[1] = this;
apCStack_60[0] = (CDataManagerBase *)0x249f5e;
(*(code *)**(undefined4 **)this)();
uVar7 = (uint)*(ushort *)(this + 0x44);
puVar1 = (ushort *)(*(int *)(this + 0x18) + uVar7 * 10);
local_44 = (uint)puVar1[2];
local_2c = 0xffffffff;
local_28 = 0;
local_30 = local_44;
iVar5 = -((local_44 * 4 + 0xf & 0xfffffff0) + 0x1e & 0x1ffff0);
local_34 = auStack_50 + iVar5;
local_24 = auStack_50 + iVar5;
uVar10 = (uint)*puVar1;
local_48 = *(int *)(this + 8);
local_40 = this + 0xc;
if (uVar10 != 0xffff) {
while( true ) {
pCVar6 = local_40;
uVar8 = (uint)*(ushort *)(*(int *)(this + 0xc) + uVar10 * 0xc + 10);
*(uint *)((int)&uStack_54 + iVar5) = uVar10;
*(uint *)((int)&uStack_58 + iVar5) = uVar7;
*(CDataManagerBase **)((int)apCStack_60 + iVar5 + 4) = pCVar6;
*(undefined4 *)((int)apCStack_60 + iVar5) = 0x249fe6;
CUtlMultiList<CDataManagerBase::resource_lru_element_t,unsigned_short>::Unlink
(*(CUtlMultiList<CDataManagerBase::resource_lru_element_t,unsigned_short> **)
((int)apCStack_60 + iVar5 + 4),*(ushort *)((int)&uStack_58 + iVar5),
*(ushort *)((int)&uStack_54 + iVar5));
*(uint *)((int)&uStack_58 + iVar5) = uVar10;
*(CDataManagerBase **)((int)apCStack_60 + iVar5 + 4) = this;
/* try { // try from 00249fed to 0024a041 has its CatchHandler @ 0024a08b */
*(undefined4 *)((int)apCStack_60 + iVar5) = 0x249ff2;
local_38 = GetForFreeByIndex(*(CDataManagerBase **)((int)apCStack_60 + iVar5 + 4),
*(ushort *)((int)&uStack_58 + iVar5));
*(undefined4 **)((int)&uStack_54 + iVar5) = &local_38;
*(undefined4 *)((int)&uStack_58 + iVar5) = local_28;
*(undefined1 ***)((int)apCStack_60 + iVar5 + 4) = &local_34;
*(undefined4 *)((int)apCStack_60 + iVar5) = 0x24a00e;
CUtlVector<void*,CUtlMemory<void*,int>>::InsertBefore
(*(CUtlVector<void*,CUtlMemory<void*,int>> **)((int)apCStack_60 + iVar5 + 4),
*(int *)((int)&uStack_58 + iVar5),*(void ***)((int)&uStack_54 + iVar5));
if (uVar8 == 0xffff) break;
uVar7 = (uint)*(ushort *)(this + 0x44);
uVar10 = uVar8;
}
}
iVar9 = *(int *)this;
*(CDataManagerBase **)((int)apCStack_60 + iVar5 + 4) = this;
pcVar2 = *(code **)(iVar9 + 8);
*(undefined4 *)((int)apCStack_60 + iVar5) = 0x24a01e;
(*pcVar2)();
if (local_44 != 0) {
iVar9 = 0;
do {
iVar3 = *(int *)this;
uVar4 = *(undefined4 *)(local_34 + iVar9 * 4);
*(CDataManagerBase **)((int)apCStack_60 + iVar5 + 4) = this;
*(undefined4 *)((int)&uStack_58 + iVar5) = uVar4;
pcVar2 = *(code **)(iVar3 + 0x14);
*(undefined4 *)((int)apCStack_60 + iVar5) = 0x24a042;
(*pcVar2)();
iVar9 = iVar9 + 1;
} while (iVar9 < (int)local_44);
}
local_28 = 0;
iVar9 = local_48 - *(int *)(this + 8);
*(undefined1 ***)((int)apCStack_60 + iVar5 + 4) = &local_34;
*(undefined4 *)((int)apCStack_60 + iVar5) = 0x24a064;
CUtlMemory<void*,int>::Purge(*(CUtlMemory<void*,int> **)((int)apCStack_60 + iVar5 + 4));
local_24 = local_34;
*(undefined1 ***)((int)apCStack_60 + iVar5 + 4) = &local_34;
*(undefined4 *)((int)apCStack_60 + iVar5) = 0x24a075;
CUtlMemory<void*,int>::Purge(*(CUtlMemory<void*,int> **)((int)apCStack_60 + iVar5 + 4));
if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
/* WARNING: Subroutine does not return */
*(undefined **)((int)apCStack_60 + iVar5) = &UNK_0024a0a5;
__stack_chk_fail();
}
return iVar9;
}
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.