L L4D2node

CDispInfo::AllocateDispDecalFragment

0x00138240 · 607 bytes · __thiscall

_ZN9CDispInfo25AllocateDispDecalFragmentEti

Decompiled

undefined (3 params)

/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* CDispInfo::AllocateDispDecalFragment(unsigned short, int) */

int __thiscall CDispInfo::AllocateDispDecalFragment(CDispInfo *this,ushort param_1,int param_2)

{
  int iVar1;
  ushort uVar2;
  int iVar3;
  void *pvVar4;
  ushort uVar5;
  uint uVar6;
  ushort uVar7;
  uint uVar8;
  int iVar9;
  uint uVar10;
  uint uVar11;
  
  uVar11 = (uint)DAT_0039ec68;
  if (DAT_0039ec68 == 0xffff) {
    if ((int)(uint)DAT_0039ec6e < DAT_0039ec5c) {
      uVar11 = DAT_0039ec6e + 1;
      uVar8 = uVar11 & 0xffff;
      if (DAT_0039ec5c <= (int)uVar8) {
        uVar11 = 0xffff;
        uVar8 = 0xffff;
      }
    }
    else {
      uVar8 = 0;
      if (DAT_0039ec5c < 1) {
        uVar8 = 0xffff;
      }
      uVar11 = (0 < DAT_0039ec5c) - 1;
    }
    if ((int)uVar8 < DAT_0039ec5c) {
LAB_001383ba:
      uVar5 = (ushort)uVar11;
      if (uVar5 != 0xffff) {
        uVar11 = uVar11 & 0xffff;
        _DAT_0039ec6c = _DAT_0039ec6c + 1;
        iVar9 = uVar11 * 0x10;
        iVar3 = s_DispDecalFragments + iVar9;
        DAT_0039ec6e = uVar5;
        goto LAB_00138277;
      }
      if (CUtlLinkedList<CDispDecalFragment,unsigned_short,true,unsigned_short,CUtlMemory<UtlLinkedListElem_t<CDispDecalFragment,unsigned_short>,unsigned_short>>
          ::AllocInternal(bool)::__executeCount < 10) {
        CUtlLinkedList<CDispDecalFragment,unsigned_short,true,unsigned_short,CUtlMemory<UtlLinkedListElem_t<CDispDecalFragment,unsigned_short>,unsigned_short>>
        ::AllocInternal(bool)::__executeCount =
             CUtlLinkedList<CDispDecalFragment,unsigned_short,true,unsigned_short,CUtlMemory<UtlLinkedListElem_t<CDispDecalFragment,unsigned_short>,unsigned_short>>
             ::AllocInternal(bool)::__executeCount + 1;
        Warning("CUtlLinkedList overflow! (exhausted index range)\n");
      }
    }
    else {
      CUtlMemory<UtlLinkedListElem_t<CDispDecalFragment,unsigned_short>,unsigned_short>::Grow
                ((CUtlMemory<UtlLinkedListElem_t<CDispDecalFragment,unsigned_short>,unsigned_short>
                  *)&s_DispDecalFragments,1);
      _DAT_0039ec70 = s_DispDecalFragments;
      if ((int)(uint)DAT_0039ec6e < DAT_0039ec5c) {
        uVar10 = DAT_0039ec6e + 1;
        uVar6 = uVar10 & 0xffff;
        uVar11 = 0xffff;
        uVar8 = 0xffff;
        if ((int)uVar6 < DAT_0039ec5c) {
          uVar11 = uVar10;
          uVar8 = uVar6;
        }
      }
      else {
        uVar8 = 0;
        if (DAT_0039ec5c < 1) {
          uVar8 = 0xffff;
        }
        uVar11 = (0 < DAT_0039ec5c) - 1;
      }
      if ((int)uVar8 < DAT_0039ec5c) goto LAB_001383ba;
      if (CUtlLinkedList<CDispDecalFragment,unsigned_short,true,unsigned_short,CUtlMemory<UtlLinkedListElem_t<CDispDecalFragment,unsigned_short>,unsigned_short>>
          ::AllocInternal(bool)::__executeCount < 10) {
        CUtlLinkedList<CDispDecalFragment,unsigned_short,true,unsigned_short,CUtlMemory<UtlLinkedListElem_t<CDispDecalFragment,unsigned_short>,unsigned_short>>
        ::AllocInternal(bool)::__executeCount =
             CUtlLinkedList<CDispDecalFragment,unsigned_short,true,unsigned_short,CUtlMemory<UtlLinkedListElem_t<CDispDecalFragment,unsigned_short>,unsigned_short>>
             ::AllocInternal(bool)::__executeCount + 1;
        iVar9 = 0xffff0;
        uVar5 = 0xffff;
        Warning("CUtlLinkedList overflow! (exhausted memory allocator)\n");
        uVar7 = 0xffff;
        goto LAB_00138289;
      }
    }
    iVar9 = 0xffff0;
    uVar7 = 0xffff;
    uVar5 = 0xffff;
  }
  else {
    iVar9 = uVar11 * 0x10;
    iVar3 = s_DispDecalFragments + iVar9;
    uVar5 = DAT_0039ec68;
    DAT_0039ec68 = *(ushort *)(iVar3 + 0xe);
LAB_00138277:
    uVar7 = (ushort)uVar11;
    *(undefined2 *)(iVar3 + 0xe) = 0xffff;
    *(undefined2 *)(iVar3 + 0xc) = 0xffff;
  }
LAB_00138289:
  uVar2 = *(ushort *)(s_DispDecals + 0x48 + (uint)param_1 * 0x50);
  CUtlLinkedList<CDispDecalFragment,unsigned_short,true,unsigned_short,CUtlMemory<UtlLinkedListElem_t<CDispDecalFragment,unsigned_short>,unsigned_short>>
  ::Unlink((CUtlLinkedList<CDispDecalFragment,unsigned_short,true,unsigned_short,CUtlMemory<UtlLinkedListElem_t<CDispDecalFragment,unsigned_short>,unsigned_short>>
            *)&s_DispDecalFragments,uVar7);
  iVar3 = s_DispDecalFragments;
  iVar9 = iVar9 + s_DispDecalFragments;
  *(ushort *)(iVar9 + 0xe) = uVar2;
  if (uVar2 == 0xffff) {
    *(ushort *)(iVar9 + 0xc) = DAT_0039ec66;
    uVar2 = uVar5;
    uVar7 = DAT_0039ec66;
  }
  else {
    iVar1 = iVar3 + (uint)uVar2 * 0x10;
    uVar7 = *(ushort *)(iVar1 + 0xc);
    *(ushort *)(iVar9 + 0xc) = uVar7;
    *(ushort *)(iVar1 + 0xc) = uVar5;
    uVar2 = DAT_0039ec66;
  }
  DAT_0039ec66 = uVar2;
  uVar2 = uVar5;
  if (uVar7 != 0xffff) {
    *(ushort *)(iVar3 + 0xe + (uint)uVar7 * 0x10) = uVar5;
    uVar2 = _DAT_0039ec64;
  }
  _DAT_0039ec64 = uVar2;
  _DAT_0039ec6a = _DAT_0039ec6a + 1;
  *(ushort *)(s_DispDecals + 0x48 + (uint)param_1 * 0x50) = uVar5;
  *(undefined1 *)(iVar9 + 8) = (undefined1)param_2;
  uVar11 = 0xffffffff;
  if ((uint)param_2 < 0x3f80001) {
    uVar11 = param_2 << 5;
  }
  pvVar4 = operator_new__(uVar11);
  *(void **)(iVar9 + 4) = pvVar4;
  return iVar9;
}

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)