L L4D2node

CDmxSerializerKeyValues2::UnserializeArrayAttribute

0x00becb30 · 516 bytes · __thiscall

_ZN24CDmxSerializerKeyValues225UnserializeArrayAttributeER10CUtlBufferiPKc17DmAttributeType_t

Decompiled

undefined (5 params)

/* CDmxSerializerKeyValues2::UnserializeArrayAttribute(CUtlBuffer&, int, char const*,
   DmAttributeType_t) */

undefined1 __thiscall
CDmxSerializerKeyValues2::UnserializeArrayAttribute
          (CDmxSerializerKeyValues2 *this,CUtlBuffer *param_1,int param_2,char *param_3,
          undefined4 param_5)

{
  char cVar1;
  undefined4 uVar2;
  int iVar3;
  CDmxElement *this_00;
  undefined1 local_61;
  int local_60;
  CUtlBuffer local_54 [68];
  
  this_00 = (CDmxElement *)0x0;
  if (param_2 != -1) {
    this_00 = *(CDmxElement **)(*(int *)this + param_2 * 0x14);
  }
  cVar1 = CDmxElement::HasAttribute(this_00,param_3);
  if (cVar1 != '\0') {
    CDmxKeyValues2ErrorStack::ReportError
              ((CDmxKeyValues2ErrorStack *)&g_KeyValues2ErrorStack,
               "Encountered duplicate attribute definition for attribute \"%s\"!",param_3);
    return 0;
  }
  CDmxElement::LockForChanges(this_00,true);
                    /* try { // try from 00becb87 to 00becb8b has its CatchHandler @ 00becd6b */
  uVar2 = CDmxElement::AddAttribute(this_00,param_3);
  if (this_00 != (CDmxElement *)0x0) {
    CDmxElement::LockForChanges(this_00,false);
  }
  CUtlBuffer::CUtlBuffer(local_54,0,0,0);
                    /* try { // try from 00becbd1 to 00beccab has its CatchHandler @ 00becd59 */
  iVar3 = ReadToken(this,param_1,local_54);
  local_61 = 0;
  if (iVar3 == 2) {
    if (param_1[0x14] == (CUtlBuffer)0x0) {
      local_60 = 0;
      do {
        iVar3 = ReadToken(this,param_1,local_54);
        if ((iVar3 == 7) || (iVar3 == -1)) {
          CDmxKeyValues2ErrorStack::ReportError
                    ((CDmxKeyValues2ErrorStack *)&g_KeyValues2ErrorStack,
                     "Expecting \']\', didn\'t find it!");
          goto LAB_00becbef;
        }
        if (iVar3 == 3) break;
        if (local_60 != 0) {
          if (iVar3 != 4) {
            CDmxKeyValues2ErrorStack::ReportError
                      ((CDmxKeyValues2ErrorStack *)&g_KeyValues2ErrorStack,
                       "Expecting \',\', didn\'t find it!");
            goto LAB_00becbef;
          }
          iVar3 = ReadToken(this,param_1,local_54);
        }
        if (iVar3 != 5) {
                    /* try { // try from 00becd07 to 00becd53 has its CatchHandler @ 00becd59 */
          CDmxKeyValues2ErrorStack::ReportError
                    ((CDmxKeyValues2ErrorStack *)&g_KeyValues2ErrorStack,
                     "Expecting array attribute value, didn\'t find it!");
          goto LAB_00becbef;
        }
        cVar1 = UnserializeAttributeValueFromToken(this,uVar2,param_5,local_54);
        if (cVar1 == '\0') {
          CDmxKeyValues2ErrorStack::ReportError
                    ((CDmxKeyValues2ErrorStack *)&g_KeyValues2ErrorStack,
                     "Error reading in array attribute \"%s\" element %d",param_3,local_60);
          goto LAB_00becbef;
        }
        local_60 = local_60 + 1;
      } while (param_1[0x14] == (CUtlBuffer)0x0);
    }
    local_61 = 1;
  }
  else {
    CDmxKeyValues2ErrorStack::ReportError
              ((CDmxKeyValues2ErrorStack *)&g_KeyValues2ErrorStack,
               "Expecting \'[\', didn\'t find it!");
  }
LAB_00becbef:
  CUtlMemory<unsigned_char,int>::Purge((CUtlMemory<unsigned_char,int> *)local_54);
  return local_61;
}

SourceMod gamedata

paste into addons/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.



        

        

          

Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.

Return-type handling cheatsheet (DHookReturn)