CStringRegistry::GetIDForKey
0x00599d80 · 169 bytes · __thiscall
_ZN15CStringRegistry11GetIDForKeyEt
Decompiled
undefined (2 params)
/* CStringRegistry::GetIDForKey(unsigned short) */
undefined4 __thiscall CStringRegistry::GetIDForKey(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) + 0xc);
}
}
return 0;
}
SourceMod gamedata
paste intoaddons/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.
Signatures + Functions block. The plugin uses
DHookCreateFromConf - DHooks reads return type, this-type,
calling convention, and argument types straight from the gamedata. Less
boilerplate in the plugin, types travel with the gamedata.
Gamedata KeyValues
DHooks plugin example
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.