L L4D2node

CDmxSerializer::UnserializeAttributes

0x00be9850 · 1382 bytes · __thiscall

_ZN14CDmxSerializer21UnserializeAttributesER10CUtlBufferP11CDmxElementR10CUtlVectorIS3_10CUtlMemoryIS3_iEEiPiPci

Decompiled

undefined (8 params)

/* CDmxSerializer::UnserializeAttributes(CUtlBuffer&, CDmxElement*, CUtlVector<CDmxElement*,
   CUtlMemory<CDmxElement*, int> >&, int, int*, char*, int) */

bool __thiscall
CDmxSerializer::UnserializeAttributes
          (CDmxSerializer *this,CUtlBuffer *param_1,CDmxElement *param_2,CUtlVector *param_3,
          int param_4,int *param_5,char *param_6,int param_7)

{
  short sVar1;
  char cVar2;
  char cVar3;
  CDmxAttribute *this_00;
  int iVar4;
  short *psVar5;
  int *piVar6;
  int iVar7;
  int in_GS_OFFSET;
  bool bVar8;
  int local_454;
  int local_44c;
  int local_448;
  char *local_444;
  char local_431;
  short local_430;
  short local_42e;
  undefined2 local_42c;
  undefined2 local_42a;
  int local_428;
  undefined4 local_424;
  char local_420 [1024];
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  CDmxElement::LockForChanges(param_2,true);
  if (((byte)param_1[0x15] & 1) == 0) {
    cVar3 = CUtlBuffer::CheckGet(param_1,4);
    if (cVar3 == '\0') goto LAB_00be9cd0;
    if (((byte)param_1[0x34] & 1) == 0) {
      iVar4 = *(int *)(param_1 + 0xc);
      local_454 = *(int *)(*(int *)param_1 + (iVar4 - *(int *)(param_1 + 0x20)));
    }
    else {
      piVar6 = (int *)((*(int *)(param_1 + 0xc) - *(int *)(param_1 + 0x20)) + *(int *)param_1);
      if (piVar6 == (int *)0x0) {
        piVar6 = &local_428;
      }
      local_424 = local_428;
      local_424 = CONCAT31((int3)((uint)local_428 >> 8),*(undefined1 *)((int)piVar6 + 3));
      local_424._2_2_ = (undefined2)((uint)local_428 >> 0x10);
      local_424._0_2_ = CONCAT11(*(undefined1 *)((int)piVar6 + 2),*(undefined1 *)((int)piVar6 + 3));
      local_424._3_1_ = (undefined1)((uint)local_428 >> 0x18);
      local_424._0_3_ = CONCAT12(*(undefined1 *)((int)piVar6 + 1),(undefined2)local_424);
      local_424 = CONCAT13((char)*piVar6,(undefined3)local_424);
      _V_memcpy(&local_428,&local_424,4);
      iVar4 = *(int *)(param_1 + 0xc);
      local_454 = local_428;
    }
    *(int *)(param_1 + 0xc) = iVar4 + 4;
  }
  else {
    local_428 = 0;
                    /* try { // try from 00be98d1 to 00be9a5f has its CatchHandler @ 00be9dec */
    CUtlBuffer::Scanf(param_1,"%d",&local_428);
    local_454 = local_428;
  }
  if (0 < local_454) {
    local_448 = 0;
    do {
      if (param_6 != (char *)0x0) {
        if (((byte)param_1[0x15] & 1) == 0) {
          cVar3 = CUtlBuffer::CheckGet(param_1,2);
          if (cVar3 == '\0') {
            iVar7 = 0;
            iVar4 = 0;
          }
          else {
            if (((byte)param_1[0x34] & 1) == 0) {
              iVar7 = *(int *)(param_1 + 0xc);
              sVar1 = *(short *)(*(int *)param_1 + (iVar7 - *(int *)(param_1 + 0x20)));
            }
            else {
              psVar5 = (short *)((*(int *)(param_1 + 0xc) - *(int *)(param_1 + 0x20)) +
                                *(int *)param_1);
              if (psVar5 == (short *)0x0) {
                psVar5 = &local_430;
              }
              local_42c = local_430;
              local_42c = CONCAT11((char)((ushort)local_430 >> 8),*(undefined1 *)((int)psVar5 + 1));
              local_42c = CONCAT11((char)*psVar5,*(undefined1 *)((int)psVar5 + 1));
              _V_memcpy(&local_430,&local_42c,2);
              iVar7 = *(int *)(param_1 + 0xc);
              sVar1 = local_430;
            }
            iVar4 = (int)sVar1;
            *(int *)(param_1 + 0xc) = iVar7 + 2;
            iVar7 = (int)sVar1;
          }
        }
        else {
          local_430 = 0;
          CUtlBuffer::Scanf(param_1,"%d",&local_430);
          iVar4 = (int)local_430;
          iVar7 = (int)local_430;
        }
        if (iVar7 < param_4) {
          local_444 = param_6 + param_5[iVar4];
          goto LAB_00be9a00;
        }
LAB_00be9a98:
        bVar8 = false;
        goto LAB_00be9a9a;
      }
      CUtlBuffer::GetString(param_1,local_420,0x400);
      local_444 = local_420;
LAB_00be9a00:
      if (((byte)param_1[0x15] & 1) == 0) {
        cVar2 = CUtlBuffer::CheckGet(param_1,1);
        local_44c = 0;
        cVar3 = '\0';
        if (cVar2 != '\0') {
          cVar3 = *(char *)(*(int *)param_1 + (*(int *)(param_1 + 0xc) - *(int *)(param_1 + 0x20)));
          *(int *)(param_1 + 0xc) = *(int *)(param_1 + 0xc) + 1;
          local_44c = (int)cVar3;
        }
      }
      else {
        local_431 = '\0';
        CUtlBuffer::Scanf(param_1,"%c",&local_431);
        local_44c = (int)local_431;
        cVar3 = local_431;
      }
      this_00 = (CDmxAttribute *)CDmxElement::AddAttribute(param_2,local_444);
      if (this_00 == (CDmxAttribute *)0x0) {
        Warning("WARNING: Failed to create attribute \'%s\' - likely out of memory in s_DMXAllocator!\n"
                ,local_444);
        goto LAB_00be9a98;
      }
      if (cVar3 == '\x05') {
        if ((param_6 == (char *)0x0) || (param_7 < 4)) {
LAB_00be996e:
          CDmxAttribute::Unserialize(this_00,local_44c,param_1);
        }
        else {
          if (((byte)param_1[0x15] & 1) == 0) {
            cVar3 = CUtlBuffer::CheckGet(param_1,2);
            if (cVar3 == '\0') {
              iVar7 = 0;
              iVar4 = 0;
            }
            else {
              if (((byte)param_1[0x34] & 1) == 0) {
                iVar7 = *(int *)(param_1 + 0xc);
                sVar1 = *(short *)(*(int *)param_1 + (iVar7 - *(int *)(param_1 + 0x20)));
              }
              else {
                psVar5 = (short *)((*(int *)(param_1 + 0xc) - *(int *)(param_1 + 0x20)) +
                                  *(int *)param_1);
                if (psVar5 == (short *)0x0) {
                  psVar5 = &local_42e;
                }
                local_42a = local_42e;
                local_42a = CONCAT11((char)((ushort)local_42e >> 8),*(undefined1 *)((int)psVar5 + 1)
                                    );
                local_42a = CONCAT11((char)*psVar5,*(undefined1 *)((int)psVar5 + 1));
                _V_memcpy(&local_42e,&local_42a,2);
                iVar7 = *(int *)(param_1 + 0xc);
                sVar1 = local_42e;
              }
              iVar4 = (int)sVar1;
              *(int *)(param_1 + 0xc) = iVar7 + 2;
              iVar7 = (int)sVar1;
            }
          }
          else {
            local_42e = 0;
            CUtlBuffer::Scanf(param_1,"%d",&local_42e);
            iVar4 = (int)local_42e;
            iVar7 = (int)local_42e;
          }
          if (param_4 <= iVar7) goto LAB_00be9a98;
          CDmxAttribute::SetValue(this_00,param_6 + param_5[iVar4]);
        }
      }
      else if (cVar3 == '\x0f') {
        UnserializeElementArrayAttribute(this,param_1,this_00,param_3);
      }
      else {
        if (cVar3 != '\x01') goto LAB_00be996e;
                    /* try { // try from 00be9af3 to 00be9dcc has its CatchHandler @ 00be9dec */
        UnserializeElementAttribute(this,param_1,this_00,param_3);
      }
      local_448 = local_448 + 1;
    } while (local_448 != local_454);
  }
LAB_00be9cd0:
  bVar8 = param_1[0x14] == (CUtlBuffer)0x0;
LAB_00be9a9a:
  if (param_2 != (CDmxElement *)0x0) {
    CDmxElement::LockForChanges(param_2,false);
  }
  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
                    /* WARNING: Subroutine does not return */
    __stack_chk_fail();
  }
  return bVar8;
}

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)