L L4D2node

CDataManagerBase::FlushAllUnlocked

0x00bdc2e0 · 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 *)0xbdc2fe;
  (*(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) = 0xbdc386;
      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 00bdc38d to 00bdc3e1 has its CatchHandler @ 00bdc42b */
      *(undefined4 *)((int)apCStack_60 + iVar5) = 0xbdc392;
      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) = 0xbdc3ae;
      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) = 0xbdc3be;
  (*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) = 0xbdc3e2;
      (*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) = 0xbdc404;
  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) = 0xbdc415;
  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_00bdc445;
    __stack_chk_fail();
  }
  return iVar9;
}

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)