L L4D2node

CDmxSerializer::UnserializeElementArrayAttribute

0x00be9670 · 458 bytes · __thiscall

_ZN14CDmxSerializer32UnserializeElementArrayAttributeER10CUtlBufferP13CDmxAttributeR10CUtlVectorIP11CDmxElement10CUtlMemoryIS6_iEE

Decompiled

undefined (4 params)

/* CDmxSerializer::UnserializeElementArrayAttribute(CUtlBuffer&, CDmxAttribute*,
   CUtlVector<CDmxElement*, CUtlMemory<CDmxElement*, int> >&) */

void __thiscall
CDmxSerializer::UnserializeElementArrayAttribute
          (CDmxSerializer *this,CUtlBuffer *param_1,CDmxAttribute *param_2,CUtlVector *param_3)

{
  undefined4 *puVar1;
  char cVar2;
  void *pvVar3;
  int iVar4;
  CDmxElement **ppCVar5;
  CUtlVector<CDmxElement*,CUtlMemory<CDmxElement*,int>> *this_00;
  CDmxElement *pCVar6;
  CDmxElement *local_30;
  CDmxElement *local_24;
  undefined4 local_20;
  
  if (((byte)param_1[0x15] & 1) == 0) {
    cVar2 = CUtlBuffer::CheckGet(param_1,4);
    local_30 = (CDmxElement *)0x0;
    if (cVar2 != '\0') {
      if (((byte)param_1[0x34] & 1) == 0) {
        iVar4 = *(int *)(param_1 + 0xc);
        local_30 = *(CDmxElement **)(*(int *)param_1 + (iVar4 - *(int *)(param_1 + 0x20)));
      }
      else {
        ppCVar5 = (CDmxElement **)
                  ((*(int *)(param_1 + 0xc) - *(int *)(param_1 + 0x20)) + *(int *)param_1);
        if (ppCVar5 == (CDmxElement **)0x0) {
          ppCVar5 = &local_24;
        }
        local_20 = local_24;
        local_20 = (CDmxElement *)
                   CONCAT31((int3)((uint)local_24 >> 8),*(undefined1 *)((int)ppCVar5 + 3));
        local_20._2_2_ = (undefined2)((uint)local_24 >> 0x10);
        local_20._0_2_ =
             CONCAT11(*(undefined1 *)((int)ppCVar5 + 2),*(undefined1 *)((int)ppCVar5 + 3));
        local_20._3_1_ = (undefined1)((uint)local_24 >> 0x18);
        local_20._0_3_ = CONCAT12(*(undefined1 *)((int)ppCVar5 + 1),(undefined2)local_20);
        local_20 = (CDmxElement *)CONCAT13(*(undefined1 *)ppCVar5,(undefined3)local_20);
        _V_memcpy(&local_24,&local_20,4);
        iVar4 = *(int *)(param_1 + 0xc);
        local_30 = local_24;
      }
      *(int *)(param_1 + 0xc) = iVar4 + 4;
      iVar4 = *(int *)param_2;
      goto joined_r0x00be97ce;
    }
  }
  else {
    local_24 = (CDmxElement *)0x0;
    CUtlBuffer::Scanf(param_1,"%d",&local_24);
    local_30 = local_24;
  }
  iVar4 = *(int *)param_2;
joined_r0x00be97ce:
  if (iVar4 == 0xf) {
    this_00 = *(CUtlVector<CDmxElement*,CUtlMemory<CDmxElement*,int>> **)(param_2 + 8);
  }
  else {
    CDmxAttribute::AllocateDataMemory(param_2,0xf);
    puVar1 = *(undefined4 **)(param_2 + 8);
    this_00 = (CUtlVector<CDmxElement*,CUtlMemory<CDmxElement*,int>> *)0x0;
    if (puVar1 != (undefined4 *)0x0) {
      *puVar1 = 0;
      puVar1[1] = 0;
      puVar1[2] = 0;
      puVar1[3] = 0;
      puVar1[4] = 0;
      this_00 = *(CUtlVector<CDmxElement*,CUtlMemory<CDmxElement*,int>> **)(param_2 + 8);
    }
  }
  if ((*(int *)(this_00 + 4) < (int)local_30) && (-1 < *(int *)(this_00 + 8))) {
    *(CDmxElement **)(this_00 + 4) = local_30;
    if (*(void **)this_00 == (void *)0x0) {
      pvVar3 = malloc((int)local_30 << 2);
      *(void **)this_00 = pvVar3;
    }
    else {
      pvVar3 = realloc(*(void **)this_00,(int)local_30 * 4);
      *(void **)this_00 = pvVar3;
    }
  }
  else {
    pvVar3 = *(void **)this_00;
  }
  *(void **)(this_00 + 0x10) = pvVar3;
  if (0 < (int)local_30) {
    pCVar6 = (CDmxElement *)0x0;
    do {
      pCVar6 = pCVar6 + 1;
      local_20 = (CDmxElement *)UnserializeElementIndex(this,param_1,param_3);
      CUtlVector<CDmxElement*,CUtlMemory<CDmxElement*,int>>::InsertBefore
                (this_00,*(int *)(this_00 + 0xc),(CDmxElement **)&local_20);
    } while (pCVar6 != local_30);
  }
  return;
}

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)