CDmxSerializerKeyValues2::UnserializeElementArrayAttribute
0x00bed780 · 865 bytes · __thiscall
_ZN24CDmxSerializerKeyValues232UnserializeElementArrayAttributeER10CUtlBufferiPKc
Decompiled
undefined (4 params)
/* CDmxSerializerKeyValues2::UnserializeElementArrayAttribute(CUtlBuffer&, int, char const*) */
undefined1 __thiscall
CDmxSerializerKeyValues2::UnserializeElementArrayAttribute
(CDmxSerializerKeyValues2 *this,CUtlBuffer *param_1,int param_2,char *param_3)
{
char cVar1;
CDmxAttribute *pCVar2;
CUtlCharConversion *pCVar3;
int iVar4;
CDmxElement *this_00;
int in_GS_OFFSET;
undefined1 local_279;
int local_270;
int local_26c;
CUtlBuffer local_268 [56];
UniqueId_t local_230 [16];
char local_220 [256];
char local_120 [256];
int local_20;
this_00 = (CDmxElement *)0x0;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
if (param_2 != -1) {
this_00 = *(CDmxElement **)(*(int *)this + param_2 * 0x14);
}
cVar1 = CDmxElement::HasAttribute(this_00,param_3);
if (cVar1 == '\0') {
CDmxElement::LockForChanges(this_00,true);
/* try { // try from 00bed7f8 to 00bed7fc has its CatchHandler @ 00bedb1a */
pCVar2 = (CDmxAttribute *)CDmxElement::AddAttribute(this_00,param_3);
if (this_00 != (CDmxElement *)0x0) {
CDmxElement::LockForChanges(this_00,false);
}
CUtlBuffer::CUtlBuffer(local_268,0,0,0);
/* try { // try from 00bed83d to 00beda2f has its CatchHandler @ 00bedb08 */
pCVar3 = (CUtlCharConversion *)GetCStringCharConversion();
iVar4 = ReadToken(this,param_1,local_268);
local_279 = 0;
if (iVar4 == 2) {
if (param_1[0x14] == (CUtlBuffer)0x0) {
local_270 = 0;
do {
iVar4 = ReadToken(this,param_1,local_268);
if ((iVar4 == 7) || (iVar4 == -1)) {
/* try { // try from 00beda87 to 00bedafd has its CatchHandler @ 00bedb08 */
CDmxKeyValues2ErrorStack::ReportError
((CDmxKeyValues2ErrorStack *)&g_KeyValues2ErrorStack,
"Expecting \']\', didn\'t find it!");
goto LAB_00bed871;
}
if (iVar4 == 3) break;
if (local_270 != 0) {
if (iVar4 != 4) {
CDmxKeyValues2ErrorStack::ReportError
((CDmxKeyValues2ErrorStack *)&g_KeyValues2ErrorStack,
"Expecting \',\', didn\'t find it!");
goto LAB_00bed871;
}
iVar4 = ReadToken(this,param_1,local_268);
}
if (iVar4 != 5) {
CDmxKeyValues2ErrorStack::ReportError
((CDmxKeyValues2ErrorStack *)&g_KeyValues2ErrorStack,
"Expecting element type, didn\'t find it!");
goto LAB_00bed871;
}
CUtlBuffer::GetDelimitedString(local_268,pCVar3,local_220,0x100);
iVar4 = _V_strcmp(local_220,DAT_00f71e44);
if (iVar4 == 0) {
iVar4 = ReadToken(this,param_1,local_268);
if (iVar4 != 5) {
CDmxKeyValues2ErrorStack::ReportError
((CDmxKeyValues2ErrorStack *)&g_KeyValues2ErrorStack,
"Expecting element reference, didn\'t find it!");
goto LAB_00bed871;
}
CUtlBuffer::GetDelimitedString(local_268,pCVar3,local_120,0x100);
cVar1 = UniqueIdFromString(local_230,local_120,0);
if (cVar1 == '\0') {
CDmxKeyValues2ErrorStack::ReportError
((CDmxKeyValues2ErrorStack *)&g_KeyValues2ErrorStack,
"Encountered invalid element ID data!");
goto LAB_00bed871;
}
CDmxElementDictionary::AddArrayAttribute((CDmxElementDictionary *)this,pCVar2,local_230)
;
}
else {
cVar1 = UnserializeElement(this,param_1,local_220,&local_26c);
if (cVar1 == '\0') goto LAB_00bed871;
CDmxElementDictionary::AddArrayAttribute((CDmxElementDictionary *)this,pCVar2,local_26c)
;
}
local_270 = local_270 + 1;
} while (param_1[0x14] == (CUtlBuffer)0x0);
}
local_279 = 1;
}
else {
CDmxKeyValues2ErrorStack::ReportError
((CDmxKeyValues2ErrorStack *)&g_KeyValues2ErrorStack,
"Expecting \'[\', didn\'t find it!");
}
LAB_00bed871:
CUtlMemory<unsigned_char,int>::Purge((CUtlMemory<unsigned_char,int> *)local_268);
}
else {
CDmxKeyValues2ErrorStack::ReportError
((CDmxKeyValues2ErrorStack *)&g_KeyValues2ErrorStack,
"Attribute \"%s\" was defined more than once.\n",param_3);
local_279 = 0;
}
if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
return local_279;
}
/* WARNING: Subroutine does not return */
__stack_chk_fail();
}
SourceMod gamedata
paste intoaddons/sourcemod/gamedata/<your_plugin>.txt
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.
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.