CUtlSymbolTable::AddString
0x002647c0 · 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 (_exit == 0) {
local_20 = 0;
}
else {
(**(code **)(_exit + 0x50))
(_exit,&local_34,0,0,0,0,"/data/src/tier1/utlsymbol.cpp",0x111,
&AddString(char_const*)::tm_fmt,"(%s)%s","Unaccounted","CUtlSymbol::AddString");
local_20 = _exit;
}
iVar8 = _DAT_0040b9d4;
local_28 = local_34;
local_24 = local_30;
/* try { // try from 0026491e to 0026496c has its CatchHandler @ 00264b0f */
if (((_DAT_0040b028 != 0) || (DAT_0040b02c == '\0')) &&
(iVar6 = ThreadGetCurrentId(), iVar8 == iVar6)) {
if ((char *)*_DAT_0040b030 != "CUtlSymbol::AddString") {
_DAT_0040b030 =
(int *)CVProfNode::GetSubNode((char *)_DAT_0040b030,0x2ccc57,&DAT_00000001,0x2a054b);
}
CVProfNode::EnterScope();
DAT_0040b02c = '\0';
}
if (in_stack_0000000c == (char *)0x0) {
param_1[0] = -1;
param_1[1] = -1;
goto LAB_002648ac;
}
/* try { // try from 00264890 to 00264894 has its CatchHandler @ 00264b24 */
Find((char *)&local_3a);
if (local_3a != -1) {
*(short *)param_1 = local_3a;
goto LAB_002648ac;
}
sVar7 = strlen(in_stack_0000000c);
uVar10 = sVar7 + 4 & 0xfffffffe;
if (*(int *)(in_stack_00000008 + 0x30) < 1) {
LAB_002649df:
__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 00264a1d to 00264aac has its CatchHandler @ 00264b24 */
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_00264a24:
if (in_stack_00000008[0x1c] ==
(CUtlRBTree<CUtlSymbolTable::CStringPoolIndex,unsigned_short,CUtlSymbolTable::CLess,CUtlMemory<UtlRBTreeNode_t<CUtlSymbolTable::CStringPoolIndex,unsigned_short>,unsigned_short>>
)0x0) goto LAB_00264a33;
LAB_00264aa8:
uVar5 = HashStringCaseless(in_stack_0000000c);
}
else {
iVar8 = 0;
piVar1 = (int *)**(int **)(in_stack_00000008 + 0x24);
if ((int)uVar10 <= *piVar1 - piVar1[1]) goto LAB_00264a24;
do {
iVar8 = iVar8 + 1;
if (iVar8 == *(int *)(in_stack_00000008 + 0x30)) goto LAB_002649df;
piVar1 = (int *)(*(int **)(in_stack_00000008 + 0x24))[iVar8];
} while (*piVar1 - piVar1[1] < (int)uVar10);
if (iVar8 == -1) goto LAB_002649df;
if (in_stack_00000008[0x1c] !=
(CUtlRBTree<CUtlSymbolTable::CStringPoolIndex,unsigned_short,CUtlSymbolTable::CLess,CUtlMemory<UtlRBTreeNode_t<CUtlSymbolTable::CStringPoolIndex,unsigned_short>,unsigned_short>>
)0x0) goto LAB_00264aa8;
LAB_00264a33:
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_002648ac:
iVar8 = _DAT_0040b9d4;
if (((DAT_0040b02c == '\0') || (_DAT_0040b028 != 0)) &&
(iVar6 = ThreadGetCurrentId(), iVar8 == iVar6)) {
cVar4 = CVProfNode::ExitScope();
if (cVar4 != '\0') {
_DAT_0040b030 = (int *)_DAT_0040b030[0x19];
}
DAT_0040b02c = _DAT_0040b030 == (int *)0x40b034;
}
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.