L L4D2node

CDataManagerBase::FlushAll

0x0024a0b0 · 502 bytes · __thiscall

_ZN16CDataManagerBase8FlushAllEv

Decompiled

undefined (1 param)

/* CDataManagerBase::FlushAll() */

undefined4 __thiscall CDataManagerBase::FlushAll(CDataManagerBase *this)

{
  ushort *puVar1;
  code *pcVar2;
  int iVar3;
  undefined4 uVar4;
  int iVar5;
  CDataManagerBase *pCVar6;
  int *piVar7;
  ushort *puVar8;
  uint uVar9;
  uint uVar10;
  int iVar11;
  uint uVar12;
  int in_GS_OFFSET;
  CDataManagerBase *apCStack_60 [2];
  uint uStack_58;
  uint uStack_54;
  undefined4 local_50;
  int local_4c;
  CDataManagerBase *local_48;
  CDataManagerBase *local_44;
  int *local_40;
  undefined4 local_38;
  int local_34;
  int local_30;
  undefined4 local_2c;
  undefined4 local_28;
  int local_24;
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  apCStack_60[1] = this;
  apCStack_60[0] = (CDataManagerBase *)0x24a0ce;
  (*(code *)**(undefined4 **)this)();
  uVar9 = (uint)*(ushort *)(this + 0x44);
  puVar1 = (ushort *)(*(int *)(this + 0x18) + uVar9 * 10);
  uVar10 = (uint)*(ushort *)(this + 0x46);
  puVar8 = (ushort *)(*(int *)(this + 0x18) + uVar10 * 10);
  local_2c = 0xffffffff;
  local_28 = 0;
  local_4c = (uint)puVar8[2] + (uint)puVar1[2];
  local_30 = local_4c;
  iVar5 = -((local_4c * 4 + 0xfU & 0xfffffff0) + 0x1e & 0x3ffff0);
  local_34 = (int)&local_50 + iVar5;
  local_24 = (int)&local_50 + iVar5;
  uVar12 = (uint)*puVar1;
  local_50 = *(undefined4 *)(this + 8);
  if (uVar12 == 0xffff) {
    local_40 = &local_34;
  }
  else {
    local_44 = this + 0xc;
    local_40 = &local_34;
    while( true ) {
      pCVar6 = local_44;
      uVar10 = (uint)*(ushort *)(*(int *)(this + 0xc) + uVar12 * 0xc + 10);
      *(uint *)((int)&uStack_54 + iVar5) = uVar12;
      *(uint *)((int)&uStack_58 + iVar5) = uVar9;
      *(CDataManagerBase **)((int)apCStack_60 + iVar5 + 4) = pCVar6;
      *(undefined4 *)((int)apCStack_60 + iVar5) = 0x24a176;
      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) = uVar12;
      *(CDataManagerBase **)((int)apCStack_60 + iVar5 + 4) = this;
                    /* try { // try from 0024a17d to 0024a261 has its CatchHandler @ 0024a2b4 */
      *(undefined4 *)((int)apCStack_60 + iVar5) = 0x24a182;
      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;
      *(int **)((int)apCStack_60 + iVar5 + 4) = local_40;
      *(undefined4 *)((int)apCStack_60 + iVar5) = 0x24a19e;
      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 (uVar10 == 0xffff) break;
      uVar9 = (uint)*(ushort *)(this + 0x44);
      uVar12 = uVar10;
    }
    uVar10 = (uint)*(ushort *)(this + 0x46);
    puVar8 = (ushort *)(*(int *)(this + 0x18) + uVar10 * 10);
  }
  local_48 = this + 0xc;
  uVar12 = (uint)*puVar8;
  if (*puVar8 != 0xffff) {
    while( true ) {
      local_44 = (CDataManagerBase *)(uVar12 * 3);
      uVar9 = (uint)*(ushort *)(*(int *)(this + 0xc) + 10 + uVar12 * 0xc);
      *(uint *)((int)&uStack_58 + iVar5) = uVar10;
      pCVar6 = local_48;
      *(uint *)((int)&uStack_54 + iVar5) = uVar12;
      *(CDataManagerBase **)((int)apCStack_60 + iVar5 + 4) = pCVar6;
      *(undefined4 *)((int)apCStack_60 + iVar5) = 0x24a1f7;
      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));
      *(undefined2 *)(*(int *)(this + 0xc) + (int)local_44 * 4) = 0;
      *(uint *)((int)&uStack_58 + iVar5) = uVar12;
      *(CDataManagerBase **)((int)apCStack_60 + iVar5 + 4) = this;
      *(undefined4 *)((int)apCStack_60 + iVar5) = 0x24a20f;
      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;
      *(int **)((int)apCStack_60 + iVar5 + 4) = local_40;
      *(undefined4 *)((int)apCStack_60 + iVar5) = 0x24a22b;
      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 (uVar9 == 0xffff) break;
      uVar10 = (uint)*(ushort *)(this + 0x46);
      uVar12 = uVar9;
    }
  }
  this[0x4a] = (CDataManagerBase)((byte)this[0x4a] & 0xfe);
  iVar11 = *(int *)this;
  *(CDataManagerBase **)((int)apCStack_60 + iVar5 + 4) = this;
  pcVar2 = *(code **)(iVar11 + 8);
  *(undefined4 *)((int)apCStack_60 + iVar5) = 0x24a23f;
  (*pcVar2)();
  if (local_4c != 0) {
    iVar11 = 0;
    do {
      iVar3 = *(int *)this;
      uVar4 = *(undefined4 *)(local_34 + iVar11 * 4);
      *(CDataManagerBase **)((int)apCStack_60 + iVar5 + 4) = this;
      *(undefined4 *)((int)&uStack_58 + iVar5) = uVar4;
      pcVar2 = *(code **)(iVar3 + 0x14);
      *(undefined4 *)((int)apCStack_60 + iVar5) = 0x24a262;
      (*pcVar2)();
      iVar11 = iVar11 + 1;
    } while (iVar11 != local_4c);
  }
  piVar7 = local_40;
  local_28 = 0;
  *(int **)((int)apCStack_60 + iVar5 + 4) = local_40;
  *(undefined4 *)((int)apCStack_60 + iVar5) = 0x24a27c;
  CUtlMemory<void*,int>::Purge(*(CUtlMemory<void*,int> **)((int)apCStack_60 + iVar5 + 4));
  iVar11 = local_34;
  *(int **)((int)apCStack_60 + iVar5 + 4) = piVar7;
  local_24 = iVar11;
  *(undefined4 *)((int)apCStack_60 + iVar5) = 0x24a28a;
  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 */
    *(undefined1 **)((int)apCStack_60 + iVar5) = &LAB_0024a2b4;
    __stack_chk_fail();
  }
  return local_50;
}

SourceMod gamedata

paste into addons/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.



        

        

          

Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.

Return-type handling cheatsheet (DHookReturn)