CUtlSymbolTable::AddString
0x00050830 · 819 bytes · __cdecl
_ZN15CUtlSymbolTable9AddStringEPKc
Decompiled
undefined (1 param)
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* CUtlSymbolTable::AddString(char const*) */
char * CUtlSymbolTable::AddString(char *param_1)
{
int *piVar1;
int iVar2;
int iVar3;
char cVar4;
undefined2 uVar5;
int iVar6;
size_t sVar7;
uint __size;
int iVar8;
uint uVar9;
uint uVar10;
CUtlRBTree<CUtlSymbolTable::CStringPoolIndex,unsigned_short,CUtlSymbolTable::CLess,CUtlMemory<UtlRBTreeNode_t<CUtlSymbolTable::CStringPoolIndex,unsigned_short>,unsigned_short>>
*in_stack_00000008;
char *in_stack_0000000c;
short local_3a;
StringPool_t *local_38;
undefined4 local_34;
undefined4 local_30;
undefined4 local_28;
undefined4 local_24;
int local_20;
local_34 = 0;
local_30 = 0;
if (_vtable == 0) {
local_20 = 0;
}
else {
(**(code **)(_vtable + 0x50))
(_vtable,&local_34,0,0,0,0,"/data/src/tier1/utlsymbol.cpp",0x111,
&AddString(char_const*)::tm_fmt,"(%s)%s","Unaccounted","CUtlSymbol::AddString");
local_20 = _vtable;
}
iVar8 = _DAT_000e89f8;
local_28 = local_34;
local_24 = local_30;
/* try { // try from 0005098e to 000509dc has its CatchHandler @ 00050b7f */
if (((_DAT_000e804c != 0) || (DAT_000e8050 == '\0')) &&
(iVar6 = ThreadGetCurrentId(), iVar8 == iVar6)) {
if ((char *)*_DAT_000e8054 != "CUtlSymbol::AddString") {
_DAT_000e8054 =
(int *)CVProfNode::GetSubNode((char *)_DAT_000e8054,0xb33b8,(char *)0x1,0xb3371);
}
CVProfNode::EnterScope();
DAT_000e8050 = '\0';
}
if (in_stack_0000000c == (char *)0x0) {
param_1[0] = -1;
param_1[1] = -1;
goto LAB_0005091c;
}
/* try { // try from 00050900 to 00050904 has its CatchHandler @ 00050b94 */
Find((char *)&local_3a);
if (local_3a != -1) {
*(short *)param_1 = local_3a;
goto LAB_0005091c;
}
sVar7 = strlen(in_stack_0000000c);
uVar10 = sVar7 + 4 & 0xfffffffe;
if (*(int *)(in_stack_00000008 + 0x30) < 1) {
LAB_00050a4f:
__size = uVar10 + 0xc;
uVar9 = uVar10;
if (__size < 0x801) {
uVar9 = 0x7f4;
__size = 0x800;
}
local_38 = malloc(__size);
*(uint *)local_38 = uVar9;
*(uint *)(local_38 + 4) = 0;
/* try { // try from 00050a8d to 00050b1c has its CatchHandler @ 00050b94 */
iVar8 = CUtlVector<CUtlSymbolTable::StringPool_t*,CUtlMemory<CUtlSymbolTable::StringPool_t*,int>>
::InsertBefore((CUtlVector<CUtlSymbolTable::StringPool_t*,CUtlMemory<CUtlSymbolTable::StringPool_t*,int>>
*)(in_stack_00000008 + 0x24),*(int *)(in_stack_00000008 + 0x30),
&local_38);
LAB_00050a94:
if (in_stack_00000008[0x1c] ==
(CUtlRBTree<CUtlSymbolTable::CStringPoolIndex,unsigned_short,CUtlSymbolTable::CLess,CUtlMemory<UtlRBTreeNode_t<CUtlSymbolTable::CStringPoolIndex,unsigned_short>,unsigned_short>>
)0x0) goto LAB_00050aa3;
LAB_00050b18:
uVar5 = HashStringCaseless(in_stack_0000000c);
}
else {
iVar8 = 0;
piVar1 = (int *)**(int **)(in_stack_00000008 + 0x24);
if ((int)uVar10 <= *piVar1 - piVar1[1]) goto LAB_00050a94;
do {
iVar8 = iVar8 + 1;
if (iVar8 == *(int *)(in_stack_00000008 + 0x30)) goto LAB_00050a4f;
piVar1 = (int *)(*(int **)(in_stack_00000008 + 0x24))[iVar8];
} while (*piVar1 - piVar1[1] < (int)uVar10);
if (iVar8 == -1) goto LAB_00050a4f;
if (in_stack_00000008[0x1c] !=
(CUtlRBTree<CUtlSymbolTable::CStringPoolIndex,unsigned_short,CUtlSymbolTable::CLess,CUtlMemory<UtlRBTreeNode_t<CUtlSymbolTable::CStringPoolIndex,unsigned_short>,unsigned_short>>
)0x0) goto LAB_00050b18;
LAB_00050aa3:
uVar5 = HashString(in_stack_0000000c);
}
iVar2 = *(int *)(*(int *)(in_stack_00000008 + 0x24) + iVar8 * 4);
iVar3 = *(int *)(iVar2 + 4);
iVar6 = iVar2 + iVar3;
*(undefined2 *)(iVar6 + 8) = uVar5;
memcpy((void *)(iVar6 + 10),in_stack_0000000c,sVar7 + 1);
*(int *)(iVar2 + 4) = *(int *)(iVar2 + 4) + uVar10;
local_38 = (StringPool_t *)CONCAT22((short)iVar3,(short)iVar8);
uVar5 = CUtlRBTree<CUtlSymbolTable::CStringPoolIndex,unsigned_short,CUtlSymbolTable::CLess,CUtlMemory<UtlRBTreeNode_t<CUtlSymbolTable::CStringPoolIndex,unsigned_short>,unsigned_short>>
::Insert(in_stack_00000008,(CStringPoolIndex *)&local_38);
*(undefined2 *)param_1 = uVar5;
LAB_0005091c:
iVar8 = _DAT_000e89f8;
if (((DAT_000e8050 == '\0') || (_DAT_000e804c != 0)) &&
(iVar6 = ThreadGetCurrentId(), iVar8 == iVar6)) {
cVar4 = CVProfNode::ExitScope();
if (cVar4 != '\0') {
_DAT_000e8054 = (int *)_DAT_000e8054[0x19];
}
DAT_000e8050 = _DAT_000e8054 == (int *)0xe8058;
}
if (local_20 != 0) {
(**(code **)(local_20 + 0x54))(local_20,local_28,local_24,0,0,0);
}
return param_1;
}
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.