L L4D2node

CBaseEntityScriptInstanceHelper::BindOnRead

0x00b449d0 · 309 bytes · __thiscall

_ZN31CBaseEntityScriptInstanceHelper10BindOnReadEP9HSCRIPT__PvPKc

Decompiled

undefined (4 params)

/* CBaseEntityScriptInstanceHelper::BindOnRead(HSCRIPT__*, void*, char const*) */

int __thiscall
CBaseEntityScriptInstanceHelper::BindOnRead
          (CBaseEntityScriptInstanceHelper *this,HSCRIPT__ *param_1,void *param_2,char *param_3)

{
  ushort uVar1;
  char cVar2;
  int iVar3;
  uint uVar4;
  int iVar5;
  char *local_14 [2];
  
  uVar4 = (uint)(ushort)g_VScriptSaveRestoreBlockHandler._20_2_;
  local_14[0] = param_3;
  if (g_VScriptSaveRestoreBlockHandler._20_2_ != -1) {
    do {
      while( true ) {
        iVar5 = uVar4 * 0x10;
        cVar2 = (*(code *)g_VScriptSaveRestoreBlockHandler._4_4_)
                          (local_14,g_VScriptSaveRestoreBlockHandler._8_4_ + 8 + iVar5);
        if (cVar2 != '\0') break;
        cVar2 = (*(code *)g_VScriptSaveRestoreBlockHandler._4_4_)
                          (g_VScriptSaveRestoreBlockHandler._8_4_ + iVar5 + 8,local_14);
        if (cVar2 == '\0') {
          iVar5 = *(int *)(g_VScriptSaveRestoreBlockHandler._8_4_ + 0xc + iVar5);
          *(HSCRIPT__ **)(iVar5 + 0x3f4) = param_1;
          return iVar5;
        }
        if ((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>>
             ::Links(unsigned_short)::s_Sentinel == '\0') &&
           (iVar3 = __cxa_guard_acquire(&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>>
                                         ::Links(unsigned_short)::s_Sentinel), iVar3 != 0)) {
          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>>
          ::Links(unsigned_short)::s_Sentinel = 0xffff;
          DAT_00f6bf9e = 0xffff;
          DAT_00f6bfa0 = 0xffff;
          __cxa_guard_release(&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>>
                               ::Links(unsigned_short)::s_Sentinel);
        }
        uVar1 = *(ushort *)(g_VScriptSaveRestoreBlockHandler._8_4_ + 2 + iVar5);
        uVar4 = (uint)uVar1;
        if (uVar1 == 0xffff) {
          return 0;
        }
      }
      if ((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>>
           ::Links(unsigned_short)::s_Sentinel == '\0') &&
         (iVar3 = __cxa_guard_acquire(&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>>
                                       ::Links(unsigned_short)::s_Sentinel), iVar3 != 0)) {
        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>>
        ::Links(unsigned_short)::s_Sentinel = 0xffff;
        DAT_00f6bf9e = 0xffff;
        DAT_00f6bfa0 = 0xffff;
        __cxa_guard_release(&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>>
                             ::Links(unsigned_short)::s_Sentinel);
      }
      uVar4 = (uint)*(ushort *)(g_VScriptSaveRestoreBlockHandler._8_4_ + iVar5);
    } while (*(ushort *)(g_VScriptSaveRestoreBlockHandler._8_4_ + iVar5) != 0xffff);
  }
  return 0;
}

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)