L L4D2node

CPhysSaveRestoreBlockHandler::PostRestore

0x004839d0 · 400 bytes · __thiscall

_ZN28CPhysSaveRestoreBlockHandler11PostRestoreEv

Decompiled

undefined (1 param)

/* CPhysSaveRestoreBlockHandler::PostRestore() */

void __thiscall CPhysSaveRestoreBlockHandler::PostRestore(CPhysSaveRestoreBlockHandler *this)

{
  ushort uVar1;
  CUtlMemory<CPhysSaveRestoreBlockHandler::QueuedItem_t,int> *this_00;
  int iVar2;
  short *psVar3;
  uint uVar4;
  ushort *puVar5;
  
  if (physenv != (int *)0x0) {
    (**(code **)(*physenv + 0xdc))(physenv);
  }
  uVar1 = *(ushort *)(this + 0x34);
  do {
    uVar4 = (uint)uVar1;
    if (CUtlRBTree<CUtlMap<CBaseEntity*,CPhysSaveRestoreBlockHandler::CEntityRestoreSet*,unsigned_short>::Node_t,unsigned_short,CUtlMap<CBaseEntity*,CPhysSaveRestoreBlockHandler::CEntityRestoreSet*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<CBaseEntity*,CPhysSaveRestoreBlockHandler::CEntityRestoreSet*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
        ::Links(unsigned_short)::s_Sentinel == '\0') {
      iVar2 = __cxa_guard_acquire(&CUtlRBTree<CUtlMap<CBaseEntity*,CPhysSaveRestoreBlockHandler::CEntityRestoreSet*,unsigned_short>::Node_t,unsigned_short,CUtlMap<CBaseEntity*,CPhysSaveRestoreBlockHandler::CEntityRestoreSet*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<CBaseEntity*,CPhysSaveRestoreBlockHandler::CEntityRestoreSet*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
                                   ::Links(unsigned_short)::s_Sentinel);
      if (iVar2 == 0) goto LAB_00483a08;
      CUtlRBTree<CUtlMap<CBaseEntity*,CPhysSaveRestoreBlockHandler::CEntityRestoreSet*,unsigned_short>::Node_t,unsigned_short,CUtlMap<CBaseEntity*,CPhysSaveRestoreBlockHandler::CEntityRestoreSet*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<CBaseEntity*,CPhysSaveRestoreBlockHandler::CEntityRestoreSet*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
      ::Links(unsigned_short)::s_Sentinel = 0xffff;
      DAT_00f165f0 = 0xffff;
      DAT_00f165f2 = 0xffff;
      __cxa_guard_release(&CUtlRBTree<CUtlMap<CBaseEntity*,CPhysSaveRestoreBlockHandler::CEntityRestoreSet*,unsigned_short>::Node_t,unsigned_short,CUtlMap<CBaseEntity*,CPhysSaveRestoreBlockHandler::CEntityRestoreSet*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<CBaseEntity*,CPhysSaveRestoreBlockHandler::CEntityRestoreSet*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
                           ::Links(unsigned_short)::s_Sentinel);
      if (uVar1 != 0xffff) goto LAB_00483a12;
LAB_00483a90:
      psVar3 = &CUtlRBTree<CUtlMap<CBaseEntity*,CPhysSaveRestoreBlockHandler::CEntityRestoreSet*,unsigned_short>::Node_t,unsigned_short,CUtlMap<CBaseEntity*,CPhysSaveRestoreBlockHandler::CEntityRestoreSet*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<CBaseEntity*,CPhysSaveRestoreBlockHandler::CEntityRestoreSet*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
                ::Links(unsigned_short)::s_Sentinel;
    }
    else {
LAB_00483a08:
      if (uVar1 == 0xffff) goto LAB_00483a90;
LAB_00483a12:
      psVar3 = (short *)(uVar4 * 0x10 + *(int *)(this + 0x28));
    }
    if (*psVar3 == -1) {
      for (; (ushort)uVar4 != 0xffff;
          uVar4 = CUtlRBTree<CUtlMap<CBaseEntity*,CPhysSaveRestoreBlockHandler::CEntityRestoreSet*,unsigned_short>::Node_t,unsigned_short,CUtlMap<CBaseEntity*,CPhysSaveRestoreBlockHandler::CEntityRestoreSet*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<CBaseEntity*,CPhysSaveRestoreBlockHandler::CEntityRestoreSet*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
                  ::NextInorder((CUtlRBTree<CUtlMap<CBaseEntity*,CPhysSaveRestoreBlockHandler::CEntityRestoreSet*,unsigned_short>::Node_t,unsigned_short,CUtlMap<CBaseEntity*,CPhysSaveRestoreBlockHandler::CEntityRestoreSet*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<CBaseEntity*,CPhysSaveRestoreBlockHandler::CEntityRestoreSet*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
                                 *)(this + 0x24),(ushort)uVar4)) {
        this_00 = *(CUtlMemory<CPhysSaveRestoreBlockHandler::QueuedItem_t,int> **)
                   ((uVar4 & 0xffff) * 0x10 + *(int *)(this + 0x28) + 0xc);
        if (this_00 != (CUtlMemory<CPhysSaveRestoreBlockHandler::QueuedItem_t,int> *)0x0) {
          *(undefined4 *)(this_00 + 0xc) = 0;
          CUtlMemory<CPhysSaveRestoreBlockHandler::QueuedItem_t,int>::Purge(this_00);
          *(undefined4 *)(this_00 + 0x10) = *(undefined4 *)this_00;
          CUtlMemory<CPhysSaveRestoreBlockHandler::QueuedItem_t,int>::Purge(this_00);
          operator_delete(this_00);
        }
      }
      CUtlRBTree<CUtlMap<CBaseEntity*,CPhysSaveRestoreBlockHandler::CEntityRestoreSet*,unsigned_short>::Node_t,unsigned_short,CUtlMap<CBaseEntity*,CPhysSaveRestoreBlockHandler::CEntityRestoreSet*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<CBaseEntity*,CPhysSaveRestoreBlockHandler::CEntityRestoreSet*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
      ::RemoveAll((CUtlRBTree<CUtlMap<CBaseEntity*,CPhysSaveRestoreBlockHandler::CEntityRestoreSet*,unsigned_short>::Node_t,unsigned_short,CUtlMap<CBaseEntity*,CPhysSaveRestoreBlockHandler::CEntityRestoreSet*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<CBaseEntity*,CPhysSaveRestoreBlockHandler::CEntityRestoreSet*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
                   *)(this + 0x24));
      CGlobalEntityList::RemoveListenerEntity((IEntityListener *)gEntList);
      return;
    }
    if (CUtlRBTree<CUtlMap<CBaseEntity*,CPhysSaveRestoreBlockHandler::CEntityRestoreSet*,unsigned_short>::Node_t,unsigned_short,CUtlMap<CBaseEntity*,CPhysSaveRestoreBlockHandler::CEntityRestoreSet*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<CBaseEntity*,CPhysSaveRestoreBlockHandler::CEntityRestoreSet*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
        ::Links(unsigned_short)::s_Sentinel == '\0') {
      iVar2 = __cxa_guard_acquire(&CUtlRBTree<CUtlMap<CBaseEntity*,CPhysSaveRestoreBlockHandler::CEntityRestoreSet*,unsigned_short>::Node_t,unsigned_short,CUtlMap<CBaseEntity*,CPhysSaveRestoreBlockHandler::CEntityRestoreSet*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<CBaseEntity*,CPhysSaveRestoreBlockHandler::CEntityRestoreSet*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
                                   ::Links(unsigned_short)::s_Sentinel);
      if (iVar2 != 0) {
        DAT_00f165f0 = 0xffff;
        CUtlRBTree<CUtlMap<CBaseEntity*,CPhysSaveRestoreBlockHandler::CEntityRestoreSet*,unsigned_short>::Node_t,unsigned_short,CUtlMap<CBaseEntity*,CPhysSaveRestoreBlockHandler::CEntityRestoreSet*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<CBaseEntity*,CPhysSaveRestoreBlockHandler::CEntityRestoreSet*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
        ::Links(unsigned_short)::s_Sentinel = 0xffff;
        DAT_00f165f2 = 0xffff;
        __cxa_guard_release(&CUtlRBTree<CUtlMap<CBaseEntity*,CPhysSaveRestoreBlockHandler::CEntityRestoreSet*,unsigned_short>::Node_t,unsigned_short,CUtlMap<CBaseEntity*,CPhysSaveRestoreBlockHandler::CEntityRestoreSet*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<CBaseEntity*,CPhysSaveRestoreBlockHandler::CEntityRestoreSet*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
                             ::Links(unsigned_short)::s_Sentinel);
      }
      if (uVar1 == 0xffff) goto LAB_00483b39;
LAB_00483a3e:
      puVar5 = (ushort *)(uVar4 * 0x10 + *(int *)(this + 0x28));
    }
    else {
      if (uVar1 != 0xffff) goto LAB_00483a3e;
LAB_00483b39:
      puVar5 = &CUtlRBTree<CUtlMap<CBaseEntity*,CPhysSaveRestoreBlockHandler::CEntityRestoreSet*,unsigned_short>::Node_t,unsigned_short,CUtlMap<CBaseEntity*,CPhysSaveRestoreBlockHandler::CEntityRestoreSet*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<CBaseEntity*,CPhysSaveRestoreBlockHandler::CEntityRestoreSet*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
                ::Links(unsigned_short)::s_Sentinel;
    }
    uVar1 = *puVar5;
  } while( true );
}

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)