KeyValues::SetUseGrowableStringTable
0x00047600 · 338 bytes · __cdecl
_ZN9KeyValues25SetUseGrowableStringTableEb
Decompiled
undefined (1 param)
/* KeyValues::SetUseGrowableStringTable(bool) */
void KeyValues::SetUseGrowableStringTable(bool param_1)
{
undefined4 *puVar1;
int iVar2;
void *pvVar3;
if (!param_1) {
s_pfGetStringForSymbol = GetStringForSymbolClassic;
s_pfGetSymbolForString = GetSymbolForStringClassic;
return;
}
s_pfGetStringForSymbol = GetStringForSymbolGrowable;
s_pfGetSymbolForString = GetSymbolForStringGrowable;
if (s_pGrowableStringTable == (undefined4 *)0x0) {
puVar1 = ::operator_new(0x48);
*puVar1 = 0;
puVar1[1] = 0;
puVar1[2] = 0;
puVar1[3] = 0;
puVar1[4] = 0;
puVar1[5] = 0;
puVar1[6] = 0;
puVar1[7] = 0;
puVar1[8] = 0;
puVar1[9] = puVar1 + 2;
puVar1[10] = puVar1 + 2;
/* try { // try from 000476bb to 000476bf has its CatchHandler @ 000477ab */
CUtlVector<CUtlVector<int,CUtlMemory<int,int>>,CUtlMemory<CUtlVector<int,CUtlMemory<int,int>>,int>>
::SetCount((CUtlVector<CUtlVector<int,CUtlMemory<int,int>>,CUtlMemory<CUtlVector<int,CUtlMemory<int,int>>,int>>
*)(puVar1 + 4),0x800);
iVar2 = 0;
do {
*(undefined4 *)(puVar1[4] + 0xc + iVar2) = 0;
*(undefined4 *)(puVar1[4] + 8 + iVar2) = 0;
iVar2 = iVar2 + 0x14;
} while (iVar2 != 0xa000);
*(undefined1 *)(puVar1 + 0xb) = 1;
puVar1[0xc] = 0x7ff;
puVar1[0xe] = 0x80000;
puVar1[0xf] = 0;
pvVar3 = malloc(0x80000);
puVar1[0x10] = 0;
puVar1[0xd] = pvVar3;
puVar1[0x11] = pvVar3;
CUtlVector<char,CUtlMemory<char,int>>::GrowVector
((CUtlVector<char,CUtlMemory<char,int>> *)(puVar1 + 0xd),1);
/* try { // try from 00047740 to 00047744 has its CatchHandler @ 0004775a */
CUtlVector<char,CUtlMemory<char,int>>::ShiftElementsRight
((CUtlVector<char,CUtlMemory<char,int>> *)(puVar1 + 0xd),0,1);
s_pGrowableStringTable = puVar1;
if ((undefined1 *)puVar1[0xd] != (undefined1 *)0x0) {
*(undefined1 *)puVar1[0xd] = 0;
}
}
return;
}
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.