L L4D2node

CVScriptSaveRestoreBlockHandler::Restore

0x00b5d7f0 · 419 bytes · __cdecl

_ZN31CVScriptSaveRestoreBlockHandler7RestoreEP8IRestoreb

Decompiled

undefined (2 params)

/* CVScriptSaveRestoreBlockHandler::Restore(IRestore*, bool) */

void CVScriptSaveRestoreBlockHandler::Restore(IRestore *param_1,bool param_2)

{
  code *pcVar1;
  CBaseEntity *pCVar2;
  undefined4 uVar3;
  int iVar4;
  int iVar5;
  undefined3 in_stack_00000009;
  undefined1 *local_54;
  CBaseEntity *local_50;
  int local_38;
  
  if ((param_1[0x20] == (IRestore)0x0) && (g_pScriptVM != (int *)0x0)) {
    return;
  }
  pCVar2 = (CBaseEntity *)
           CGlobalEntityList::NextEnt((CGlobalEntityList *)gEntList,(CBaseEntity *)0x0);
  for (; pCVar2 != (CBaseEntity *)0x0;
      pCVar2 = (CBaseEntity *)CGlobalEntityList::NextEnt((CGlobalEntityList *)gEntList,pCVar2)) {
    if (*(int *)(pCVar2 + 0x3f8) != 0) {
      pcVar1 = *(code **)(*g_pScriptVM + 0x58);
      uVar3 = (**(code **)(*(int *)pCVar2 + 0x34))(pCVar2);
      (*pcVar1)(g_pScriptVM,uVar3);
      local_54 = &DAT_00d539c2;
      if (*(undefined1 **)(pCVar2 + 0x3f8) != (undefined1 *)0x0) {
        local_54 = *(undefined1 **)(pCVar2 + 0x3f8);
      }
      local_50 = pCVar2;
      CUtlRBTree<CUtlMap<char_const*,CBaseEntity*,unsigned_short>::Node_t,unsigned_short,CUtlMap<char_const*,CBaseEntity*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,CBaseEntity*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
      ::Insert((CUtlRBTree<CUtlMap<char_const*,CBaseEntity*,unsigned_short>::Node_t,unsigned_short,CUtlMap<char_const*,CBaseEntity*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,CBaseEntity*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
                *)(param_1 + 4),(Node_t *)&local_54);
    }
  }
  (**(code **)(*_param_2 + 0x1c))(_param_2);
  iVar4 = (**(code **)(*_param_2 + 0x3c))(_param_2);
  if (iVar4 != 0) {
    iVar4 = (**(code **)(*_param_2 + 0x3c))(_param_2);
    iVar5 = (**(code **)(*g_pScriptVM + 0x10))(g_pScriptVM);
    if ((iVar4 == iVar5) && (iVar4 = (**(code **)(*_param_2 + 0x3c))(_param_2), 0 < iVar4)) {
      CUtlBuffer::CUtlBuffer((CUtlBuffer *)&local_54,0,0,0);
                    /* try { // try from 00b5d940 to 00b5d98e has its CatchHandler @ 00b5d99c */
      CUtlBuffer::EnsureCapacity((CUtlBuffer *)&local_54,iVar4);
      pcVar1 = *(code **)(*_param_2 + 0x48);
      CUtlBuffer::EnsureCapacity((CUtlBuffer *)&local_54,iVar4);
      local_38 = iVar4;
      (*pcVar1)(_param_2,local_54,iVar4,0);
      (**(code **)(*g_pScriptVM + 0xb8))(g_pScriptVM,(CUtlBuffer *)&local_54);
      CUtlMemory<unsigned_char,int>::Purge((CUtlMemory<unsigned_char,int> *)&local_54);
    }
  }
  (**(code **)(*_param_2 + 0x20))(_param_2);
  return;
}

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)