CStringRegistry::GetStringID
0x00599a90 · 510 bytes · __thiscall
_ZN15CStringRegistry11GetStringIDEPKc
Decompiled
undefined (2 params)
/* CStringRegistry::GetStringID(char const*) */
undefined4 __thiscall CStringRegistry::GetStringID(CStringRegistry *this,char *param_1)
{
char cVar1;
ushort *puVar2;
int iVar3;
int iVar4;
undefined4 *puVar5;
ushort uVar6;
uint uVar7;
uint uVar8;
char *local_24 [5];
puVar5 = *(undefined4 **)this;
if (param_1 == (char *)0x0) {
uVar8 = 0xffff;
uVar7 = 0xffff;
}
else {
uVar7 = (uint)*(ushort *)(puVar5 + 4);
local_24[0] = param_1;
if (*(ushort *)(puVar5 + 4) == 0xffff) {
uVar8 = 0xffff;
}
else {
iVar3 = puVar5[1];
uVar8 = uVar7;
do {
while( true ) {
iVar4 = uVar8 * 0x10;
cVar1 = (*(code *)*puVar5)(local_24,iVar3 + 8 + iVar4);
if (cVar1 != '\0') break;
cVar1 = (*(code *)*puVar5)(puVar5[1] + iVar4 + 8,local_24);
if (cVar1 == '\0') {
puVar5 = *(undefined4 **)this;
uVar7 = uVar8;
goto LAB_00599b3a;
}
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') {
iVar3 = __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 (iVar3 != 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);
}
}
iVar3 = puVar5[1];
uVar6 = *(ushort *)(iVar3 + 2 + iVar4);
uVar8 = (uint)uVar6;
uVar7 = uVar8;
if (uVar6 == 0xffff) goto LAB_00599b30;
}
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') {
iVar3 = __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 (iVar3 != 0) {
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_00f2131a = 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);
}
}
iVar3 = puVar5[1];
uVar8 = (uint)*(ushort *)(iVar3 + iVar4);
uVar7 = uVar8;
} while (*(ushort *)(iVar3 + iVar4) != 0xffff);
LAB_00599b30:
puVar5 = *(undefined4 **)this;
uVar8 = 0xffff;
}
}
LAB_00599b3a:
if (((int)uVar8 < (int)puVar5[2]) &&
(uVar6 = (ushort)uVar7, uVar6 <= *(ushort *)((int)puVar5 + 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') {
iVar3 = __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 (iVar3 != 0) {
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_00f2131a = 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 (uVar6 == 0xffff) {
puVar2 = &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 {
puVar2 = (ushort *)(uVar7 * 0x10 + puVar5[1]);
}
if (uVar6 != *puVar2) {
return *(undefined4 *)(uVar7 * 0x10 + *(int *)(*(int *)this + 4) + 0xc);
}
}
return 0xffffffff;
}
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.