L L4D2node

CGameEventManager::GetEventDescriptor

0x00162e70 · 441 bytes · __thiscall

_ZN17CGameEventManager18GetEventDescriptorEPKcPi

Decompiled

undefined (3 params)

/* CGameEventManager::GetEventDescriptor(char const*, int*) */

int __thiscall
CGameEventManager::GetEventDescriptor(CGameEventManager *this,char *param_1,int *param_2)

{
  int iVar1;
  uint uVar2;
  char cVar3;
  int iVar4;
  int iVar5;
  char *local_24 [5];
  
  if ((param_1 != (char *)0x0) && (*param_1 != '\0')) {
    if ((param_2 != (int *)0x0) && (*param_2 != 0)) {
      iVar4 = (*param_2 & 0x7fffffffU) * 0x34 + *(int *)(this + 4);
      iVar5 = _V_stricmp(*(char **)(*(int *)(this + 0x7c) + *(int *)(iVar4 + 4) * 0x18 + 0x10),
                         param_1);
      if (iVar5 == 0) {
        return iVar4;
      }
    }
    iVar5 = *(int *)(this + 0x88);
    local_24[0] = param_1;
    if (iVar5 != -1) {
      iVar4 = *(int *)(this + 0x7c);
      do {
        while( true ) {
          iVar1 = iVar5 * 0x18;
          cVar3 = (**(code **)(this + 0x78))(local_24,iVar4 + 0x10 + iVar1);
          if (cVar3 != '\0') break;
          cVar3 = (**(code **)(this + 0x78))(*(int *)(this + 0x7c) + iVar1 + 0x10,local_24);
          if (cVar3 == '\0') {
            if (iVar5 == -1) {
              return 0;
            }
            uVar2 = *(uint *)(*(int *)(this + 0x7c) + 0x14 + iVar1);
            if (param_2 != (int *)0x0) {
              *param_2 = uVar2 | 0x80000000;
            }
            return uVar2 * 0x34 + *(int *)(this + 4);
          }
          if ((CUtlRBTree<CUtlMap<char_const*,int,int>::Node_t,int,CUtlMap<char_const*,int,int>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,int,int>::Node_t,int>,int>>
               ::Links(int)::s_Sentinel == '\0') &&
             (iVar5 = __cxa_guard_acquire(&CUtlRBTree<CUtlMap<char_const*,int,int>::Node_t,int,CUtlMap<char_const*,int,int>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,int,int>::Node_t,int>,int>>
                                           ::Links(int)::s_Sentinel), iVar5 != 0)) {
            CUtlRBTree<CUtlMap<char_const*,int,int>::Node_t,int,CUtlMap<char_const*,int,int>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,int,int>::Node_t,int>,int>>
            ::Links(int)::s_Sentinel = 0xffffffff;
            DAT_0034075c = 0xffffffff;
            DAT_00340760 = 0xffffffff;
            __cxa_guard_release(&CUtlRBTree<CUtlMap<char_const*,int,int>::Node_t,int,CUtlMap<char_const*,int,int>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,int,int>::Node_t,int>,int>>
                                 ::Links(int)::s_Sentinel);
          }
          iVar4 = *(int *)(this + 0x7c);
          iVar5 = *(int *)(iVar4 + 4 + iVar1);
          if (iVar5 == -1) {
            return 0;
          }
        }
        if ((CUtlRBTree<CUtlMap<char_const*,int,int>::Node_t,int,CUtlMap<char_const*,int,int>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,int,int>::Node_t,int>,int>>
             ::Links(int)::s_Sentinel == '\0') &&
           (iVar4 = __cxa_guard_acquire(&CUtlRBTree<CUtlMap<char_const*,int,int>::Node_t,int,CUtlMap<char_const*,int,int>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,int,int>::Node_t,int>,int>>
                                         ::Links(int)::s_Sentinel), iVar4 != 0)) {
          CUtlRBTree<CUtlMap<char_const*,int,int>::Node_t,int,CUtlMap<char_const*,int,int>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,int,int>::Node_t,int>,int>>
          ::Links(int)::s_Sentinel = 0xffffffff;
          DAT_0034075c = 0xffffffff;
          DAT_00340760 = 0xffffffff;
          __cxa_guard_release(&CUtlRBTree<CUtlMap<char_const*,int,int>::Node_t,int,CUtlMap<char_const*,int,int>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,int,int>::Node_t,int>,int>>
                               ::Links(int)::s_Sentinel);
        }
        iVar4 = *(int *)(this + 0x7c);
        iVar5 = *(int *)(iVar4 + iVar5 * 0x18);
      } while (iVar5 != -1);
    }
  }
  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)