CDmxSerializerKeyValues2::ReadToken
0x00bec750 · 574 bytes · __thiscall
_ZN24CDmxSerializerKeyValues29ReadTokenER10CUtlBufferS1_
Decompiled
undefined (3 params)
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* CDmxSerializerKeyValues2::ReadToken(CUtlBuffer&, CUtlBuffer&) */
undefined4 __thiscall
CDmxSerializerKeyValues2::ReadToken
(CDmxSerializerKeyValues2 *this,CUtlBuffer *param_1,CUtlBuffer *param_2)
{
char cVar1;
CUtlCharConversion *pCVar2;
int iVar3;
char *pcVar4;
int iVar5;
int iVar6;
undefined4 uVar7;
EatWhitespacesAndComments(this,param_1);
if (param_1[0x14] != (CUtlBuffer)0x0) {
return 7;
}
if (*(int *)(param_1 + 0xc) == *(int *)(param_1 + 0x1c)) {
return 7;
}
pcVar4 = (char *)((*(int *)(param_1 + 0xc) - *(int *)(param_1 + 0x20)) + *(int *)param_1);
cVar1 = *pcVar4;
if (cVar1 == '[') {
uVar7 = 2;
}
else if (cVar1 < '\\') {
if (cVar1 == '\"') {
pCVar2 = (CUtlCharConversion *)GetCStringCharConversion();
iVar3 = CUtlBuffer::PeekDelimitedStringLength(param_1,pCVar2,false);
iVar6 = iVar3 + -1;
if (1 < iVar6) {
if (*(char *)(*(int *)param_1 +
((iVar3 + -2 + *(int *)(param_1 + 0xc)) - *(int *)(param_1 + 0x20))) == '\"') {
pcVar4 = (char *)(*(int *)param_1 + (*(int *)(param_1 + 0xc) - *(int *)(param_1 + 0x20)));
uVar7 = 5;
goto LAB_00bec8af;
}
}
CDmxKeyValues2ErrorStack::ReportError
((CDmxKeyValues2ErrorStack *)&g_KeyValues2ErrorStack,
"Unexpected EOF in quoted string");
CUtlBuffer::SetExternalBuffer
(param_2,(void *)((*(int *)(param_1 + 0xc) - *(int *)(param_1 + 0x20)) +
*(int *)param_1),iVar6,iVar6,9);
CUtlBuffer::SeekGet(param_1,1,iVar6);
iVar3 = *(int *)param_2;
if (iVar6 < 1) {
return 0xffffffff;
}
uVar7 = 0xffffffff;
goto LAB_00bec85a;
}
uVar7 = 4;
if (cVar1 != ',') {
LAB_00bec7ae:
CUtlBuffer::SetExternalBuffer(param_2,pcVar4,0,0,9);
CUtlBuffer::SeekGet(param_1,1,0);
return 0xffffffff;
}
}
else {
if (cVar1 == '{') {
uVar7 = 0;
iVar6 = 1;
LAB_00bec8af:
CUtlBuffer::SetExternalBuffer(param_2,pcVar4,iVar6,iVar6,9);
CUtlBuffer::SeekGet(param_1,1,iVar6);
iVar3 = *(int *)param_2;
goto LAB_00bec85a;
}
if (cVar1 == '}') {
uVar7 = 1;
}
else {
if (cVar1 != ']') goto LAB_00bec7ae;
uVar7 = 3;
}
}
iVar6 = 1;
CUtlBuffer::SetExternalBuffer(param_2,pcVar4,1,1,9);
CUtlBuffer::SeekGet(param_1,1,1);
iVar3 = *(int *)param_2;
LAB_00bec85a:
iVar5 = 0;
do {
while (*(char *)(iVar3 + iVar5) == '\n') {
_DAT_0105b764 = _DAT_0105b764 + 1;
iVar5 = iVar5 + 1;
if (iVar6 <= iVar5) {
return uVar7;
}
}
iVar5 = iVar5 + 1;
} while (iVar5 < iVar6);
return uVar7;
}
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.