L L4D2node

GCSDK::CGCBase::FindSOCache

0x0007a370 · 561 bytes · __thiscall

_ZN5GCSDK7CGCBase11FindSOCacheERK8CSteamID

Decompiled

undefined (2 params)

/* GCSDK::CGCBase::FindSOCache(CSteamID const&) */

undefined4 __thiscall GCSDK::CGCBase::FindSOCache(CGCBase *this,CSteamID *param_1)

{
  int iVar1;
  ushort uVar2;
  char cVar3;
  int iVar4;
  ushort *puVar5;
  uint uVar6;
  undefined4 local_28;
  undefined4 local_24;
  
  local_24 = *(undefined4 *)(param_1 + 4);
  local_28 = *(undefined4 *)param_1;
  uVar2 = *(ushort *)(this + 0x184);
  if (uVar2 != 0xffff) {
    iVar4 = *(int *)(this + 0x178);
    do {
      while( true ) {
        uVar6 = (uint)uVar2;
        iVar1 = uVar6 * 0x14;
        cVar3 = (**(code **)(this + 0x174))(&local_28,iVar4 + 8 + iVar1);
        if (cVar3 != '\0') break;
        cVar3 = (**(code **)(this + 0x174))(*(int *)(this + 0x178) + iVar1 + 8,&local_28);
        if (cVar3 == '\0') goto LAB_0007a452;
        if ((CUtlRBTree<CUtlMap<CSteamID,GCSDK::CSharedObjectCache*,unsigned_short>::Node_t,unsigned_short,CUtlMap<CSteamID,GCSDK::CSharedObjectCache*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<CSteamID,GCSDK::CSharedObjectCache*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
             ::Links(unsigned_short)::s_Sentinel == '\0') &&
           (iVar4 = __cxa_guard_acquire(&CUtlRBTree<CUtlMap<CSteamID,GCSDK::CSharedObjectCache*,unsigned_short>::Node_t,unsigned_short,CUtlMap<CSteamID,GCSDK::CSharedObjectCache*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<CSteamID,GCSDK::CSharedObjectCache*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
                                         ::Links(unsigned_short)::s_Sentinel), iVar4 != 0)) {
          CUtlRBTree<CUtlMap<CSteamID,GCSDK::CSharedObjectCache*,unsigned_short>::Node_t,unsigned_short,CUtlMap<CSteamID,GCSDK::CSharedObjectCache*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<CSteamID,GCSDK::CSharedObjectCache*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
          ::Links(unsigned_short)::s_Sentinel = 0xffff;
          DAT_000d287a = 0xffff;
          DAT_000d287c = 0xffff;
          __cxa_guard_release(&CUtlRBTree<CUtlMap<CSteamID,GCSDK::CSharedObjectCache*,unsigned_short>::Node_t,unsigned_short,CUtlMap<CSteamID,GCSDK::CSharedObjectCache*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<CSteamID,GCSDK::CSharedObjectCache*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
                               ::Links(unsigned_short)::s_Sentinel);
        }
        iVar4 = *(int *)(this + 0x178);
        uVar2 = *(ushort *)(iVar4 + 2 + iVar1);
        if (uVar2 == 0xffff) goto LAB_0007a444;
      }
      if ((CUtlRBTree<CUtlMap<CSteamID,GCSDK::CSharedObjectCache*,unsigned_short>::Node_t,unsigned_short,CUtlMap<CSteamID,GCSDK::CSharedObjectCache*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<CSteamID,GCSDK::CSharedObjectCache*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
           ::Links(unsigned_short)::s_Sentinel == '\0') &&
         (iVar4 = __cxa_guard_acquire(&CUtlRBTree<CUtlMap<CSteamID,GCSDK::CSharedObjectCache*,unsigned_short>::Node_t,unsigned_short,CUtlMap<CSteamID,GCSDK::CSharedObjectCache*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<CSteamID,GCSDK::CSharedObjectCache*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
                                       ::Links(unsigned_short)::s_Sentinel), iVar4 != 0)) {
        CUtlRBTree<CUtlMap<CSteamID,GCSDK::CSharedObjectCache*,unsigned_short>::Node_t,unsigned_short,CUtlMap<CSteamID,GCSDK::CSharedObjectCache*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<CSteamID,GCSDK::CSharedObjectCache*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
        ::Links(unsigned_short)::s_Sentinel = 0xffff;
        DAT_000d287a = 0xffff;
        DAT_000d287c = 0xffff;
        __cxa_guard_release(&CUtlRBTree<CUtlMap<CSteamID,GCSDK::CSharedObjectCache*,unsigned_short>::Node_t,unsigned_short,CUtlMap<CSteamID,GCSDK::CSharedObjectCache*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<CSteamID,GCSDK::CSharedObjectCache*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
                             ::Links(unsigned_short)::s_Sentinel);
      }
      iVar4 = *(int *)(this + 0x178);
      uVar2 = *(ushort *)(iVar4 + uVar6 * 0x14);
    } while (uVar2 != 0xffff);
  }
LAB_0007a444:
  uVar6 = 0xffff;
  uVar2 = 0xffff;
LAB_0007a452:
  if (((int)uVar6 < *(int *)(this + 0x17c)) && (uVar2 <= *(ushort *)(this + 0x18a))) {
    if ((CUtlRBTree<CUtlMap<CSteamID,GCSDK::CSharedObjectCache*,unsigned_short>::Node_t,unsigned_short,CUtlMap<CSteamID,GCSDK::CSharedObjectCache*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<CSteamID,GCSDK::CSharedObjectCache*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
         ::Links(unsigned_short)::s_Sentinel == '\0') &&
       (iVar4 = __cxa_guard_acquire(&CUtlRBTree<CUtlMap<CSteamID,GCSDK::CSharedObjectCache*,unsigned_short>::Node_t,unsigned_short,CUtlMap<CSteamID,GCSDK::CSharedObjectCache*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<CSteamID,GCSDK::CSharedObjectCache*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
                                     ::Links(unsigned_short)::s_Sentinel), iVar4 != 0)) {
      CUtlRBTree<CUtlMap<CSteamID,GCSDK::CSharedObjectCache*,unsigned_short>::Node_t,unsigned_short,CUtlMap<CSteamID,GCSDK::CSharedObjectCache*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<CSteamID,GCSDK::CSharedObjectCache*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
      ::Links(unsigned_short)::s_Sentinel = 0xffff;
      DAT_000d287a = 0xffff;
      DAT_000d287c = 0xffff;
      __cxa_guard_release(&CUtlRBTree<CUtlMap<CSteamID,GCSDK::CSharedObjectCache*,unsigned_short>::Node_t,unsigned_short,CUtlMap<CSteamID,GCSDK::CSharedObjectCache*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<CSteamID,GCSDK::CSharedObjectCache*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
                           ::Links(unsigned_short)::s_Sentinel);
    }
    if (uVar2 == 0xffff) {
      puVar5 = &CUtlRBTree<CUtlMap<CSteamID,GCSDK::CSharedObjectCache*,unsigned_short>::Node_t,unsigned_short,CUtlMap<CSteamID,GCSDK::CSharedObjectCache*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<CSteamID,GCSDK::CSharedObjectCache*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
                ::Links(unsigned_short)::s_Sentinel;
    }
    else {
      puVar5 = (ushort *)(*(int *)(this + 0x178) + (uint)uVar2 * 0x14);
    }
    if (*puVar5 != uVar2) {
      return *(undefined4 *)(*(int *)(this + 0x178) + (uint)uVar2 * 0x14 + 0x10);
    }
  }
  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)