L L4D2node

CDmxElement::AddAttributesFromStructure

0x00be74e0 · 512 bytes · __thiscall

_ZN11CDmxElement26AddAttributesFromStructureEPKvPK27DmxElementUnpackStructure_t

Decompiled

undefined (3 params)

/* CDmxElement::AddAttributesFromStructure(void const*, DmxElementUnpackStructure_t const*) */

void __thiscall
CDmxElement::AddAttributesFromStructure
          (CDmxElement *this,void *param_1,DmxElementUnpackStructure_t *param_2)

{
  CDmxElement *this_00;
  int iVar1;
  CDmxAttribute *pCVar2;
  char *pcVar3;
  byte bVar4;
  uint uVar5;
  CUtlString *this_01;
  int local_38;
  int local_30;
  int local_20 [4];
  
  iVar1 = *(int *)(param_2 + 8);
  do {
    if (iVar1 == 0) {
      return;
    }
    this_01 = (CUtlString *)((int)param_1 + *(int *)(param_2 + 0xc));
    if (*(int *)(param_2 + 0x24) == 0) {
      if (((0xd < iVar1 - 0xfU) && (iVar1 != 6)) &&
         (iVar1 = FindAttribute(this,*(char **)param_2), iVar1 < 0)) {
        this[0x2e] = (CDmxElement)((char)this[0x2e] + '\x01');
                    /* try { // try from 00be75c5 to 00be76dd has its CatchHandler @ 00be76fd */
        pCVar2 = (CDmxAttribute *)AddAttribute(this,*(char **)param_2);
        iVar1 = *(int *)(param_2 + 8);
        if (iVar1 == 5) {
          if (*(int *)(param_2 + 0x10) == -1) {
            pcVar3 = (char *)CUtlString::Get(this_01);
            CDmxAttribute::SetValue(pCVar2,pcVar3);
          }
          else {
            CDmxAttribute::SetValue(pCVar2,(char *)this_01);
          }
        }
        else {
          local_30 = *(int *)(param_2 + 0x10);
          if ((iVar1 == 3) && (local_30 == 0x10)) {
            local_38 = *(int *)(param_2 + 0x14);
            if (local_38 == -1) {
              local_30 = 4;
            }
            else {
LAB_00be7606:
              uVar5 = (1 << ((byte)local_30 & 0x1f)) + -1 << ((byte)local_38 & 0x1f);
LAB_00be761a:
              uVar5 = uVar5 & *(uint *)this_01;
              if (((*(uint *)(param_2 + 0x18) & 0xfffffffb) == 2) ||
                 (*(uint *)(param_2 + 0x18) == 4)) {
                bVar4 = 0x20 - ((byte)local_30 + (byte)local_38);
                uVar5 = (int)(uVar5 << (bVar4 & 0x1f)) >> (bVar4 & 0x1f);
              }
              local_30 = 4;
              local_20[0] = (int)uVar5 >> ((byte)local_38 & 0x1f);
              this_01 = (CUtlString *)local_20;
            }
          }
          else {
            local_38 = *(int *)(param_2 + 0x14);
            if (local_38 != -1) {
              uVar5 = 0xffffffff;
              if (local_30 != 0x20) goto LAB_00be7606;
              goto LAB_00be761a;
            }
          }
          CDmxAttribute::SetValue(pCVar2,iVar1,this_01,local_30);
        }
        goto LAB_00be756a;
      }
    }
    else {
      pcVar3 = *(char **)(param_2 + 0x20);
      this_00 = (CDmxElement *)DMXAlloc(0x30);
      CDmxElement(this_00,pcVar3);
      AddAttributesFromStructure(this_00,this_01,*(DmxElementUnpackStructure_t **)(param_2 + 0x24));
      pcVar3 = *(char **)param_2;
      this[0x2e] = (CDmxElement)((char)this[0x2e] + '\x01');
                    /* try { // try from 00be7547 to 00be755d has its CatchHandler @ 00be76e3 */
      pCVar2 = (CDmxAttribute *)AddAttribute(this,pcVar3);
      CDmxAttribute::AllocateDataMemory(pCVar2,1);
      if (*(undefined4 **)(pCVar2 + 8) != (undefined4 *)0x0) {
        **(undefined4 **)(pCVar2 + 8) = this_00;
      }
LAB_00be756a:
      LockForChanges(this,false);
    }
    iVar1 = *(int *)(param_2 + 0x30);
    param_2 = param_2 + 0x28;
  } while( true );
}

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)