L L4D2node

CAppSystemGroup::FindSystem

0x0026b150 · 424 bytes · __thiscall

_ZN15CAppSystemGroup10FindSystemEPKc

Decompiled

undefined (2 params)

/* CAppSystemGroup::FindSystem(char const*) */

int __thiscall CAppSystemGroup::FindSystem(CAppSystemGroup *this,char *param_1)

{
  ushort uVar1;
  int *piVar2;
  char cVar3;
  int iVar4;
  uint uVar5;
  uint uVar6;
  int iVar7;
  char *local_24 [5];
  
  if (param_1 != (char *)0x0) {
    uVar5 = (uint)*(ushort *)(this + 0x3c);
    local_24[0] = param_1;
    if (*(ushort *)(this + 0x3c) != 0xffff) {
      iVar4 = *(int *)(this + 0x30);
      do {
        while( true ) {
          iVar7 = uVar5 * 0x10;
          cVar3 = (**(code **)(this + 0x2c))(local_24,iVar4 + 8 + iVar7);
          if (cVar3 != '\0') break;
          cVar3 = (**(code **)(this + 0x2c))(*(int *)(this + 0x30) + iVar7 + 8,local_24);
          if (cVar3 == '\0') {
            if ((short)uVar5 != -1) {
              return *(int *)(*(int *)(this + 0x18) +
                             *(int *)(*(int *)(this + 0x30) + 0xc + iVar7) * 4);
            }
            goto LAB_0026b1ed;
          }
          if ((CUtlRBTree<CUtlMap<char_const*,int,unsigned_short>::Node_t,unsigned_short,CUtlMap<char_const*,int,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,int,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
               ::Links(unsigned_short)::s_Sentinel == '\0') &&
             (iVar4 = __cxa_guard_acquire(&CUtlRBTree<CUtlMap<char_const*,int,unsigned_short>::Node_t,unsigned_short,CUtlMap<char_const*,int,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,int,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
                                           ::Links(unsigned_short)::s_Sentinel), iVar4 != 0)) {
            CUtlRBTree<CUtlMap<char_const*,int,unsigned_short>::Node_t,unsigned_short,CUtlMap<char_const*,int,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,int,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
            ::Links(unsigned_short)::s_Sentinel = 0xffff;
            DAT_0034189e = 0xffff;
            DAT_003418a0 = 0xffff;
            __cxa_guard_release(&CUtlRBTree<CUtlMap<char_const*,int,unsigned_short>::Node_t,unsigned_short,CUtlMap<char_const*,int,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,int,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
                                 ::Links(unsigned_short)::s_Sentinel);
          }
          iVar4 = *(int *)(this + 0x30);
          uVar1 = *(ushort *)(iVar4 + 2 + iVar7);
          uVar5 = (uint)uVar1;
          if (uVar1 == 0xffff) goto LAB_0026b1ed;
        }
        if ((CUtlRBTree<CUtlMap<char_const*,int,unsigned_short>::Node_t,unsigned_short,CUtlMap<char_const*,int,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,int,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
             ::Links(unsigned_short)::s_Sentinel == '\0') &&
           (iVar4 = __cxa_guard_acquire(&CUtlRBTree<CUtlMap<char_const*,int,unsigned_short>::Node_t,unsigned_short,CUtlMap<char_const*,int,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,int,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
                                         ::Links(unsigned_short)::s_Sentinel), iVar4 != 0)) {
          CUtlRBTree<CUtlMap<char_const*,int,unsigned_short>::Node_t,unsigned_short,CUtlMap<char_const*,int,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,int,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
          ::Links(unsigned_short)::s_Sentinel = 0xffff;
          DAT_0034189e = 0xffff;
          DAT_003418a0 = 0xffff;
          __cxa_guard_release(&CUtlRBTree<CUtlMap<char_const*,int,unsigned_short>::Node_t,unsigned_short,CUtlMap<char_const*,int,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,int,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
                               ::Links(unsigned_short)::s_Sentinel);
        }
        iVar4 = *(int *)(this + 0x30);
        uVar5 = (uint)*(ushort *)(iVar4 + iVar7);
      } while (*(ushort *)(iVar4 + iVar7) != 0xffff);
    }
  }
LAB_0026b1ed:
  uVar6 = 0;
  uVar5 = 0;
  if (0 < *(int *)(this + 0x24)) {
    do {
      piVar2 = *(int **)(*(int *)(this + 0x18) + uVar5 * 4);
      iVar4 = (**(code **)(*piVar2 + 8))(piVar2,param_1);
      if (iVar4 != 0) {
        return iVar4;
      }
      uVar6 = uVar6 + 1;
      uVar5 = uVar6 & 0xffff;
    } while ((int)uVar5 < *(int *)(this + 0x24));
  }
  if (*(CAppSystemGroup **)(this + 0x48) == (CAppSystemGroup *)0x0) {
    return 0;
  }
  iVar4 = FindSystem(*(CAppSystemGroup **)(this + 0x48),param_1);
  return iVar4;
}

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)