KeyValues::GetString
0x0024e4f0 · 379 bytes · __thiscall
_ZN9KeyValues9GetStringEPKcS1_
Decompiled
undefined (3 params)
/* KeyValues::GetString(char const*, char const*) */
char * __thiscall KeyValues::GetString(KeyValues *this,char *param_1,char *param_2)
{
int iVar1;
int iVar2;
int in_GS_OFFSET;
char local_220 [512];
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
iVar1 = FindKey(this,param_1,false);
if (iVar1 == 0) {
switchD_0024e53c_caseD_0:
goto LAB_0024e595;
}
switch(*(undefined1 *)(iVar1 + 0x10)) {
default:
goto switchD_0024e53c_caseD_0;
case 1:
goto switchD_0024e53c_caseD_1;
case 2:
case 4:
V_snprintf(local_220,0x40,"%d",*(undefined4 *)(iVar1 + 0xc));
break;
case 3:
V_snprintf(local_220,0x40,"%f",(double)*(float *)(iVar1 + 0xc));
break;
case 5:
iVar2 = V_UnicodeToUTF8(*(wchar_t **)(iVar1 + 8),local_220,0x200);
if (iVar2 == 0) goto LAB_0024e595;
SetString(this,param_1,local_220);
goto switchD_0024e53c_caseD_1;
case 7:
V_snprintf(local_220,0x40,"%lld",**(undefined4 **)(iVar1 + 4),(*(undefined4 **)(iVar1 + 4))[1]);
}
SetString(this,param_1,local_220);
switchD_0024e53c_caseD_1:
param_2 = *(char **)(iVar1 + 4);
LAB_0024e595:
if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
return param_2;
}
/* WARNING: Subroutine does not return */
__stack_chk_fail();
}
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.