L L4D2node

CDmxSerializerKeyValues2::UnserializeElementAttribute

0x00bedf20 · 249 bytes · __thiscall

_ZN24CDmxSerializerKeyValues227UnserializeElementAttributeER10CUtlBufferiPKcS3_

Decompiled

undefined (5 params)

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

undefined4 __thiscall
CDmxSerializerKeyValues2::UnserializeElementAttribute
          (CDmxSerializerKeyValues2 *this,CUtlBuffer *param_1,int param_2,char *param_3,
          char *param_4)

{
  char cVar1;
  undefined4 uVar2;
  CDmxAttribute *pCVar3;
  CDmxElement *this_00;
  int local_20 [4];
  
  this_00 = (CDmxElement *)0x0;
  if (param_2 != -1) {
    this_00 = *(CDmxElement **)(param_2 * 0x14 + *(int *)this);
  }
  uVar2 = CDmxElement::HasAttribute(this_00,param_3);
  if ((char)uVar2 == '\0') {
    CDmxElement::LockForChanges(this_00,true);
                    /* try { // try from 00bedf70 to 00bedf74 has its CatchHandler @ 00bee01f */
    pCVar3 = (CDmxAttribute *)CDmxElement::AddAttribute(this_00,param_3);
    if (this_00 != (CDmxElement *)0x0) {
      CDmxElement::LockForChanges(this_00,false);
    }
    cVar1 = UnserializeElement(this,param_1,param_4,local_20);
    if (cVar1 != '\0') {
      uVar2 = 0;
      if (local_20[0] != -1) {
        uVar2 = *(undefined4 *)(local_20[0] * 0x14 + *(int *)this);
      }
      CDmxAttribute::AllocateDataMemory(pCVar3,1);
      if (*(undefined4 **)(pCVar3 + 8) == (undefined4 *)0x0) {
        uVar2 = 1;
      }
      else {
        **(undefined4 **)(pCVar3 + 8) = uVar2;
        uVar2 = 1;
      }
    }
    return uVar2;
  }
  CDmxKeyValues2ErrorStack::ReportError
            ((CDmxKeyValues2ErrorStack *)&g_KeyValues2ErrorStack,
             "Attribute \"%s\" was defined more than once.\n",param_3);
  return 0;
}

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)