KeyValues::LoadFromBuffer
0x00b733f0 · 234 bytes · __thiscall
_ZN9KeyValues14LoadFromBufferEPKcS1_P15IBaseFileSystemS1_
Decompiled
undefined (5 params)
/* KeyValues::LoadFromBuffer(char const*, char const*, IBaseFileSystem*, char const*) */
undefined4 __thiscall
KeyValues::LoadFromBuffer
(KeyValues *this,char *param_1,char *param_2,IBaseFileSystem *param_3,char *param_4)
{
int iVar1;
undefined4 uVar2;
uint uVar3;
char *pcVar4;
CUtlBuffer local_54 [68];
if (param_2 != (char *)0x0) {
iVar1 = _V_strlen(param_2);
CUtlBuffer::CUtlBuffer(local_54,param_2,iVar1,9);
if (((2 < iVar1) && (*param_2 == -1)) && (param_2[1] == -2)) {
uVar3 = V_UnicodeToUTF8((wchar_t *)(param_2 + 2),(char *)0x0,0);
pcVar4 = operator_new__(uVar3);
V_UnicodeToUTF8((wchar_t *)(param_2 + 2),pcVar4,uVar3);
CUtlBuffer::AssumeMemory(local_54,pcVar4,uVar3,uVar3,9);
}
/* try { // try from 00b7344e to 00b734de has its CatchHandler @ 00b734e4 */
uVar2 = LoadFromBuffer(this,param_1,local_54,param_3,param_4);
CUtlMemory<unsigned_char,int>::Purge((CUtlMemory<unsigned_char,int> *)local_54);
return uVar2;
}
return 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.