L L4D2node

CParticleSystemDefinition::ParseChildren

0x00bd3d00 · 1063 bytes · __thiscall

_ZN25CParticleSystemDefinition13ParseChildrenEP11CDmxElement

Decompiled

undefined (2 params)

/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* CParticleSystemDefinition::ParseChildren(CDmxElement*) */

void __thiscall
CParticleSystemDefinition::ParseChildren(CParticleSystemDefinition *this,CDmxElement *param_1)

{
  byte bVar1;
  int *piVar2;
  char *pcVar3;
  int iVar4;
  undefined4 uVar5;
  UniqueId_t *pUVar6;
  int iVar7;
  void *pvVar8;
  int iVar9;
  int iVar10;
  CDmxElement *pCVar11;
  int iVar12;
  UniqueId_t *pUVar13;
  int iVar14;
  undefined1 *puVar15;
  
  piVar2 = (int *)CDmxElement::GetAttribute(param_1,"children");
  if (piVar2 == (int *)0x0) {
    if ((CDmxElement::GetArray<CDmxElement*>(char_const*)::defaultValue == '\0') &&
       (iVar10 = __cxa_guard_acquire(&CDmxElement::GetArray<CDmxElement*>(char_const*)::defaultValue
                                    ), iVar10 != 0)) {
      CDmxElement::GetArray<CDmxElement*>(char_const*)::defaultValue._0_4_ = 0;
      CDmxElement::GetArray<CDmxElement*>(char_const*)::defaultValue._4_4_ = 0;
      CDmxElement::GetArray<CDmxElement*>(char_const*)::defaultValue._8_4_ = 0;
      CDmxElement::GetArray<CDmxElement*>(char_const*)::defaultValue._12_4_ = 0;
      CDmxElement::GetArray<CDmxElement*>(char_const*)::defaultValue._16_4_ = 0;
      __cxa_guard_release(&CDmxElement::GetArray<CDmxElement*>(char_const*)::defaultValue);
      __cxa_atexit(CUtlVector<CDmxElement*,CUtlMemory<CDmxElement*,int>>::~CUtlVector,
                   CDmxElement::GetArray<CDmxElement*>(char_const*)::defaultValue,&__dso_handle);
    }
    puVar15 = CDmxElement::GetArray<CDmxElement*>(char_const*)::defaultValue;
  }
  else if (*piVar2 == 0xf) {
    puVar15 = (undefined1 *)piVar2[2];
  }
  else {
    if ((CDmxAttribute::GetArray<CDmxElement*>()::defaultArray == '\0') &&
       (iVar10 = __cxa_guard_acquire(&CDmxAttribute::GetArray<CDmxElement*>()::defaultArray),
       iVar10 != 0)) {
      CDmxAttribute::GetArray<CDmxElement*>()::defaultArray = 0;
      _DAT_0105b0f0 = 0;
      _DAT_0105b0f4 = 0;
      DAT_0105b0f8 = 0;
      _DAT_0105b0fc = 0;
      __cxa_guard_release(&CDmxAttribute::GetArray<CDmxElement*>()::defaultArray);
      __cxa_atexit(CUtlVector<CDmxElement*,CUtlMemory<CDmxElement*,int>>::~CUtlVector,
                   &CDmxAttribute::GetArray<CDmxElement*>()::defaultArray,&__dso_handle);
    }
    puVar15 = (undefined1 *)&CDmxAttribute::GetArray<CDmxElement*>()::defaultArray;
  }
  iVar10 = *(int *)((int)puVar15 + 0xc);
  iVar14 = 0;
  if (0 < iVar10) {
    do {
      while( true ) {
        piVar2 = (int *)CDmxElement::GetAttribute
                                  (*(CDmxElement **)(*(int *)puVar15 + iVar14 * 4),"child");
        if (piVar2 != (int *)0x0) break;
        CDmxElement::GetValue<CDmxElement*>(char_const*)::defaultValue = 0;
LAB_00bd3d5a:
        iVar14 = iVar14 + 1;
        if (iVar14 == iVar10) {
          return;
        }
      }
      if (*piVar2 != 1) {
        CDmxAttribute::GetValue<CDmxElement*>()::defaultValue = 0;
        goto LAB_00bd3d5a;
      }
      pCVar11 = *(CDmxElement **)piVar2[2];
      if (pCVar11 == (CDmxElement *)0x0) goto LAB_00bd3d5a;
      pcVar3 = (char *)CDmxElement::GetTypeString(pCVar11);
      iVar4 = _V_stricmp(pcVar3,"DmeParticleSystemDefinition");
      if (iVar4 != 0) goto LAB_00bd3d5a;
      iVar12 = *(int *)(this + 0x38c);
      iVar9 = *(int *)(this + 900);
      iVar4 = iVar12 + 1;
      if (iVar9 < iVar4) {
        iVar7 = *(int *)(this + 0x388);
        if (iVar7 < 0) goto LAB_00bd3dd7;
        if (iVar7 == 0) {
          if (iVar9 == 0) {
            if (iVar4 < 3) {
              iVar7 = 2;
              goto LAB_00bd3f6f;
            }
            iVar9 = 2;
          }
          do {
            iVar7 = iVar9 * 2;
            if (iVar4 <= iVar7) break;
            iVar7 = iVar9 * 4;
            iVar9 = iVar7;
          } while (iVar7 < iVar4);
        }
        else {
          for (iVar7 = (iVar12 / iVar7 + 1) * iVar7; iVar7 < iVar4; iVar7 = (iVar7 + iVar4) / 2) {
          }
        }
LAB_00bd3f6f:
        *(int *)(this + 900) = iVar7;
        if (*(void **)(this + 0x380) == (void *)0x0) {
          pvVar8 = malloc(iVar7 * 0x1c);
          *(void **)(this + 0x380) = pvVar8;
        }
        else {
          pvVar8 = realloc(*(void **)(this + 0x380),iVar7 * 0x1c);
          *(void **)(this + 0x380) = pvVar8;
          iVar4 = *(int *)(this + 0x38c) + 1;
        }
      }
      else {
LAB_00bd3dd7:
        pvVar8 = *(void **)(this + 0x380);
      }
      *(int *)(this + 0x38c) = iVar4;
      *(void **)(this + 0x390) = pvVar8;
      iVar4 = (iVar4 - iVar12) + -1;
      iVar12 = iVar12 * 0x1c;
      if (0 < iVar4) {
        _V_memmove((void *)((int)pvVar8 + iVar12 + 0x1c),(void *)((int)pvVar8 + iVar12),iVar4 * 0x1c
                  );
        pvVar8 = *(void **)(this + 0x380);
      }
      CDmxElement::UnpackIntoStructure
                (*(CDmxElement **)(*(int *)puVar15 + iVar14 * 4),(void *)((int)pvVar8 + iVar12),
                 s_ChildrenInfoUnpack);
      iVar4 = *(int *)(this + 0x380);
      piVar2 = (int *)CDmxElement::GetAttribute(pCVar11,"preventNameBasedLookup");
      if (piVar2 == (int *)0x0) {
        CDmxElement::GetValue<bool>(char_const*)::defaultValue = 0;
        bVar1 = 1;
      }
      else if (*piVar2 == 4) {
        bVar1 = *(byte *)piVar2[2] ^ 1;
      }
      else {
        CDmxAttribute::GetValue<bool>()::defaultValue = 0;
        bVar1 = 1;
      }
      *(byte *)(iVar4 + iVar12 + 0x14) = bVar1;
      pUVar13 = (UniqueId_t *)(iVar12 + *(int *)(this + 0x380));
      if (pUVar13[0x14] == (UniqueId_t)0x0) {
        pUVar6 = (UniqueId_t *)CDmxElement::GetId(pCVar11);
        CopyUniqueId(pUVar6,pUVar13);
        pCVar11 = (CDmxElement *)g_pParticleSystemMgr;
      }
      else {
        iVar4 = CDmxElement::GetName(pCVar11);
        if (iVar4 == 0) {
          uVar5 = 0xffff;
        }
        else {
          uVar5 = CParticleSystemDictionary::FindOrAddParticleSystemHandle
                            (*(char **)(g_pParticleSystemMgr + 0x8c));
        }
        pCVar11 = (CDmxElement *)g_pParticleSystemMgr;
        *(undefined4 *)(pUVar13 + 0x10) = uVar5;
      }
      iVar14 = iVar14 + 1;
      CParticleSystemMgr::AddParticleSystem(pCVar11);
    } while (iVar14 != iVar10);
  }
  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)