L L4D2node

CStringRegistry::GetStringForKey

0x00599cc0 · 171 bytes · __thiscall

_ZN15CStringRegistry15GetStringForKeyEt

Decompiled

undefined (2 params)

/* CStringRegistry::GetStringForKey(unsigned short) */

undefined4 __thiscall CStringRegistry::GetStringForKey(CStringRegistry *this,ushort param_1)

{
  int iVar1;
  uint uVar2;
  ushort *puVar3;
  int iVar4;
  
  iVar1 = *(int *)this;
  uVar2 = (uint)param_1;
  if (((int)uVar2 < *(int *)(iVar1 + 8)) && (param_1 <= *(ushort *)(iVar1 + 0x16))) {
    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);
      if (iVar4 != 0) {
        DAT_00f2131a = 0xffff;
        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_00f2131c = 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);
      }
    }
    if (param_1 == 0xffff) {
      puVar3 = &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;
    }
    else {
      puVar3 = (ushort *)(uVar2 * 0x10 + *(int *)(iVar1 + 4));
    }
    if (param_1 != *puVar3) {
      return *(undefined4 *)(uVar2 * 0x10 + *(int *)(*(int *)this + 4) + 8);
    }
  }
  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)