L L4D2node

GCSDK::CSharedObjectCache::GetTypeCache

0x000722c0 · 564 bytes · __thiscall

_ZN5GCSDK18CSharedObjectCache12GetTypeCacheEib

Decompiled

undefined (3 params)

/* GCSDK::CSharedObjectCache::GetTypeCache(int, bool) */

undefined4 * __thiscall
GCSDK::CSharedObjectCache::GetTypeCache(CSharedObjectCache *this,int param_1,bool param_2)

{
  char cVar1;
  ushort *puVar2;
  int iVar3;
  int iVar4;
  undefined4 *puVar5;
  ushort uVar6;
  uint uVar7;
  int local_24;
  undefined4 *local_20;
  
  uVar7 = (uint)*(ushort *)(this + 0x1c);
  local_24 = param_1;
  if (*(ushort *)(this + 0x1c) != 0xffff) {
    iVar3 = *(int *)(this + 0x10);
    do {
      while( true ) {
        iVar4 = uVar7 * 0x10;
        cVar1 = (**(code **)(this + 0xc))(&local_24,iVar3 + 8 + iVar4);
        if (cVar1 != '\0') break;
        cVar1 = (**(code **)(this + 0xc))(*(int *)(this + 0x10) + iVar4 + 8,&local_24);
        if (cVar1 == '\0') goto LAB_0007236c;
        if ((CUtlRBTree<CUtlMap<int,GCSDK::CSharedObjectTypeCache*,unsigned_short>::Node_t,unsigned_short,CUtlMap<int,GCSDK::CSharedObjectTypeCache*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<int,GCSDK::CSharedObjectTypeCache*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
             ::Links(unsigned_short)::s_Sentinel == '\0') &&
           (iVar3 = __cxa_guard_acquire(&CUtlRBTree<CUtlMap<int,GCSDK::CSharedObjectTypeCache*,unsigned_short>::Node_t,unsigned_short,CUtlMap<int,GCSDK::CSharedObjectTypeCache*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<int,GCSDK::CSharedObjectTypeCache*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
                                         ::Links(unsigned_short)::s_Sentinel), iVar3 != 0)) {
          DAT_000d285a = 0xffff;
          CUtlRBTree<CUtlMap<int,GCSDK::CSharedObjectTypeCache*,unsigned_short>::Node_t,unsigned_short,CUtlMap<int,GCSDK::CSharedObjectTypeCache*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<int,GCSDK::CSharedObjectTypeCache*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
          ::Links(unsigned_short)::s_Sentinel = 0xffff;
          DAT_000d285c = 0xffff;
          __cxa_guard_release(&CUtlRBTree<CUtlMap<int,GCSDK::CSharedObjectTypeCache*,unsigned_short>::Node_t,unsigned_short,CUtlMap<int,GCSDK::CSharedObjectTypeCache*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<int,GCSDK::CSharedObjectTypeCache*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
                               ::Links(unsigned_short)::s_Sentinel);
        }
        iVar3 = *(int *)(this + 0x10);
        uVar6 = *(ushort *)(iVar3 + 2 + iVar4);
        uVar7 = (uint)uVar6;
        if (uVar6 == 0xffff) goto LAB_00072362;
      }
      if ((CUtlRBTree<CUtlMap<int,GCSDK::CSharedObjectTypeCache*,unsigned_short>::Node_t,unsigned_short,CUtlMap<int,GCSDK::CSharedObjectTypeCache*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<int,GCSDK::CSharedObjectTypeCache*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
           ::Links(unsigned_short)::s_Sentinel == '\0') &&
         (iVar3 = __cxa_guard_acquire(&CUtlRBTree<CUtlMap<int,GCSDK::CSharedObjectTypeCache*,unsigned_short>::Node_t,unsigned_short,CUtlMap<int,GCSDK::CSharedObjectTypeCache*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<int,GCSDK::CSharedObjectTypeCache*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
                                       ::Links(unsigned_short)::s_Sentinel), iVar3 != 0)) {
        CUtlRBTree<CUtlMap<int,GCSDK::CSharedObjectTypeCache*,unsigned_short>::Node_t,unsigned_short,CUtlMap<int,GCSDK::CSharedObjectTypeCache*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<int,GCSDK::CSharedObjectTypeCache*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
        ::Links(unsigned_short)::s_Sentinel = 0xffff;
        DAT_000d285a = 0xffff;
        DAT_000d285c = 0xffff;
        __cxa_guard_release(&CUtlRBTree<CUtlMap<int,GCSDK::CSharedObjectTypeCache*,unsigned_short>::Node_t,unsigned_short,CUtlMap<int,GCSDK::CSharedObjectTypeCache*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<int,GCSDK::CSharedObjectTypeCache*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
                             ::Links(unsigned_short)::s_Sentinel);
      }
      iVar3 = *(int *)(this + 0x10);
      uVar7 = (uint)*(ushort *)(iVar3 + iVar4);
    } while (*(ushort *)(iVar3 + iVar4) != 0xffff);
  }
LAB_00072362:
  uVar7 = 0xffff;
LAB_0007236c:
  if (((int)uVar7 < *(int *)(this + 0x14)) &&
     (uVar6 = (ushort)uVar7, uVar6 <= *(ushort *)(this + 0x22))) {
    if ((CUtlRBTree<CUtlMap<int,GCSDK::CSharedObjectTypeCache*,unsigned_short>::Node_t,unsigned_short,CUtlMap<int,GCSDK::CSharedObjectTypeCache*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<int,GCSDK::CSharedObjectTypeCache*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
         ::Links(unsigned_short)::s_Sentinel == '\0') &&
       (iVar3 = __cxa_guard_acquire(&CUtlRBTree<CUtlMap<int,GCSDK::CSharedObjectTypeCache*,unsigned_short>::Node_t,unsigned_short,CUtlMap<int,GCSDK::CSharedObjectTypeCache*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<int,GCSDK::CSharedObjectTypeCache*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
                                     ::Links(unsigned_short)::s_Sentinel), iVar3 != 0)) {
      CUtlRBTree<CUtlMap<int,GCSDK::CSharedObjectTypeCache*,unsigned_short>::Node_t,unsigned_short,CUtlMap<int,GCSDK::CSharedObjectTypeCache*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<int,GCSDK::CSharedObjectTypeCache*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
      ::Links(unsigned_short)::s_Sentinel = 0xffff;
      DAT_000d285a = 0xffff;
      DAT_000d285c = 0xffff;
      __cxa_guard_release(&CUtlRBTree<CUtlMap<int,GCSDK::CSharedObjectTypeCache*,unsigned_short>::Node_t,unsigned_short,CUtlMap<int,GCSDK::CSharedObjectTypeCache*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<int,GCSDK::CSharedObjectTypeCache*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
                           ::Links(unsigned_short)::s_Sentinel);
    }
    if (uVar6 == 0xffff) {
      puVar2 = &CUtlRBTree<CUtlMap<int,GCSDK::CSharedObjectTypeCache*,unsigned_short>::Node_t,unsigned_short,CUtlMap<int,GCSDK::CSharedObjectTypeCache*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<int,GCSDK::CSharedObjectTypeCache*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
                ::Links(unsigned_short)::s_Sentinel;
    }
    else {
      puVar2 = (ushort *)(uVar7 * 0x10 + *(int *)(this + 0x10));
    }
    if (uVar6 != *puVar2) {
      return *(undefined4 **)(uVar7 * 0x10 + *(int *)(this + 0x10) + 0xc);
    }
  }
  puVar5 = (undefined4 *)0x0;
  if (param_2) {
    puVar5 = operator_new(0x20);
    *puVar5 = &PTR__CSharedObjectTypeCache_000b5b00;
    puVar5[1] = 0;
    puVar5[2] = 0;
    puVar5[3] = 0;
    puVar5[4] = 0;
    puVar5[5] = 0;
    puVar5[6] = this + 0x28;
    puVar5[7] = param_1;
    local_24 = param_1;
    local_20 = puVar5;
    CUtlRBTree<CUtlMap<int,GCSDK::CSharedObjectTypeCache*,unsigned_short>::Node_t,unsigned_short,CUtlMap<int,GCSDK::CSharedObjectTypeCache*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<int,GCSDK::CSharedObjectTypeCache*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
    ::Insert((CUtlRBTree<CUtlMap<int,GCSDK::CSharedObjectTypeCache*,unsigned_short>::Node_t,unsigned_short,CUtlMap<int,GCSDK::CSharedObjectTypeCache*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<int,GCSDK::CSharedObjectTypeCache*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
              *)(this + 0xc),(Node_t *)&local_24);
  }
  return puVar5;
}

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)