L L4D2node

GCSDK::CGCBase::FindGSSession

0x0007a6c0 · 205 bytes · __thiscall

_ZNK5GCSDK7CGCBase13FindGSSessionERK8CSteamID

Decompiled

undefined (2 params)

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

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

{
  ushort uVar1;
  int iVar2;
  ushort *puVar3;
  uint uVar4;
  undefined4 local_28;
  undefined4 local_24;
  
  local_24 = *(undefined4 *)(param_1 + 4);
  local_28 = *(undefined4 *)param_1;
  uVar1 = CUtlRBTree<CUtlMap<CSteamID,GCSDK::CGCGSSession*,unsigned_short>::Node_t,unsigned_short,CUtlMap<CSteamID,GCSDK::CGCGSSession*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<CSteamID,GCSDK::CGCGSSession*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
          ::Find((CUtlRBTree<CUtlMap<CSteamID,GCSDK::CGCGSSession*,unsigned_short>::Node_t,unsigned_short,CUtlMap<CSteamID,GCSDK::CGCGSSession*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<CSteamID,GCSDK::CGCGSSession*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
                  *)(this + 0x158),(Node_t *)&local_28);
  uVar4 = (uint)uVar1;
  if (((int)uVar4 < *(int *)(this + 0x160)) && (uVar1 <= *(ushort *)(this + 0x16e))) {
    if (CUtlRBTree<CUtlMap<CSteamID,GCSDK::CGCGSSession*,unsigned_short>::Node_t,unsigned_short,CUtlMap<CSteamID,GCSDK::CGCGSSession*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<CSteamID,GCSDK::CGCGSSession*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
        ::Links(unsigned_short)::s_Sentinel == '\0') {
      iVar2 = __cxa_guard_acquire(&CUtlRBTree<CUtlMap<CSteamID,GCSDK::CGCGSSession*,unsigned_short>::Node_t,unsigned_short,CUtlMap<CSteamID,GCSDK::CGCGSSession*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<CSteamID,GCSDK::CGCGSSession*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
                                   ::Links(unsigned_short)::s_Sentinel);
      if (iVar2 != 0) {
        DAT_000d2872 = 0xffff;
        CUtlRBTree<CUtlMap<CSteamID,GCSDK::CGCGSSession*,unsigned_short>::Node_t,unsigned_short,CUtlMap<CSteamID,GCSDK::CGCGSSession*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<CSteamID,GCSDK::CGCGSSession*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
        ::Links(unsigned_short)::s_Sentinel = 0xffff;
        DAT_000d2874 = 0xffff;
        __cxa_guard_release(&CUtlRBTree<CUtlMap<CSteamID,GCSDK::CGCGSSession*,unsigned_short>::Node_t,unsigned_short,CUtlMap<CSteamID,GCSDK::CGCGSSession*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<CSteamID,GCSDK::CGCGSSession*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
                             ::Links(unsigned_short)::s_Sentinel);
      }
    }
    if (uVar1 == 0xffff) {
      puVar3 = &CUtlRBTree<CUtlMap<CSteamID,GCSDK::CGCGSSession*,unsigned_short>::Node_t,unsigned_short,CUtlMap<CSteamID,GCSDK::CGCGSSession*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<CSteamID,GCSDK::CGCGSSession*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
                ::Links(unsigned_short)::s_Sentinel;
    }
    else {
      puVar3 = (ushort *)(*(int *)(this + 0x15c) + uVar4 * 0x14);
    }
    if (uVar1 != *puVar3) {
      return *(undefined4 *)(*(int *)(this + 0x15c) + uVar4 * 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)