L L4D2node

CUtlLinkedList<LeafListData_t,int,true,int,CUtlFixedMemory<UtlLinkedListElem_t<LeafListData_t,int>>>::AllocInternal

0x001e35a0 · 528 bytes · __thiscall

_ZN14CUtlLinkedListI14LeafListData_tiLb1Ei15CUtlFixedMemoryI19UtlLinkedListElem_tIS0_iEEE13AllocInternalEb

Decompiled

undefined (2 params)

/* CUtlLinkedList<LeafListData_t, int, true, int,
   CUtlFixedMemory<UtlLinkedListElem_t<LeafListData_t, int> > >::AllocInternal(bool) */

int * __thiscall
CUtlLinkedList<LeafListData_t,int,true,int,CUtlFixedMemory<UtlLinkedListElem_t<LeafListData_t,int>>>
::AllocInternal(CUtlLinkedList<LeafListData_t,int,true,int,CUtlFixedMemory<UtlLinkedListElem_t<LeafListData_t,int>>>
                *this,bool param_1)

{
  int *piVar1;
  undefined4 *puVar2;
  int *piVar3;
  int *piVar4;
  size_t __size;
  undefined4 *puVar5;
  int iVar6;
  int *piVar7;
  undefined4 *puVar8;
  int local_20;
  
  piVar1 = *(int **)(this + 0x14);
  if (piVar1 != (int *)0x0) {
    *(int *)(this + 0x14) = piVar1[3];
    piVar4 = piVar1;
    piVar7 = piVar1;
    goto joined_r0x001e362a;
  }
  piVar3 = *(int **)(this + 0x20);
  if (((piVar3 == (int *)0x0) || (iVar6 = *(int *)(this + 0x24), iVar6 < 0)) || (piVar3[1] <= iVar6)
     ) {
    piVar3 = *(int **)this;
    if (piVar3 == (int *)0x0) goto LAB_001e364f;
LAB_001e35d1:
    if (piVar3[1] < 1) goto LAB_001e364f;
LAB_001e35d8:
    iVar6 = 0;
  }
  else {
    iVar6 = iVar6 + 1;
    if (piVar3[1] <= iVar6) {
      piVar3 = (int *)*piVar3;
      if (piVar3 != (int *)0x0) goto LAB_001e35d1;
LAB_001e364f:
      iVar6 = *(int *)(this + 8);
      if (iVar6 == 0) {
        iVar6 = *(int *)(this + 4);
        local_20 = iVar6;
        if (iVar6 != 0) goto LAB_001e3660;
        __size = 0x28;
        local_20 = 0;
        iVar6 = 2;
      }
      else {
        local_20 = *(int *)(this + 4);
LAB_001e3660:
        if (iVar6 < 1) {
          iVar6 = iVar6 * (iVar6 / iVar6);
        }
        __size = iVar6 * 0x10 + 8;
      }
      *(int *)(this + 4) = local_20 + iVar6;
      puVar5 = malloc(__size);
      if (puVar5 == (undefined4 *)0x0) {
        Error("CUtlFixedMemory overflow!\n");
      }
      *puVar5 = 0;
      puVar5[1] = iVar6;
      puVar2 = *(undefined4 **)this;
      if (*(undefined4 **)this == (undefined4 *)0x0) {
        *(undefined4 **)this = puVar5;
      }
      else {
        do {
          puVar8 = puVar2;
          puVar2 = (undefined4 *)*puVar8;
        } while (puVar2 != (undefined4 *)0x0);
        *puVar8 = puVar5;
      }
      piVar3 = *(int **)(this + 0x20);
      *(undefined4 *)(this + 0x28) = 0;
      if (((piVar3 == (int *)0x0) || (iVar6 = *(int *)(this + 0x24), iVar6 < 0)) ||
         (piVar3[1] <= iVar6)) {
        piVar3 = *(int **)this;
      }
      else {
        iVar6 = iVar6 + 1;
        if (iVar6 < piVar3[1]) {
          if (iVar6 < 0) goto LAB_001e36eb;
          goto LAB_001e35da;
        }
        piVar3 = (int *)*piVar3;
      }
      if ((piVar3 == (int *)0x0) || (piVar3[1] < 1)) {
LAB_001e36eb:
        if (AllocInternal(bool)::__executeCount < 10) {
          AllocInternal(bool)::__executeCount = AllocInternal(bool)::__executeCount + 1;
          Warning("CUtlLinkedList overflow! (exhausted memory allocator)\n");
          return (int *)0x0;
        }
        return (int *)0x0;
      }
      goto LAB_001e35d8;
    }
    if (iVar6 < 0) goto LAB_001e364f;
  }
LAB_001e35da:
  piVar4 = piVar3 + iVar6 * 4 + 2;
  if (piVar4 == (int *)0x0) {
    if (AllocInternal(bool)::__executeCount < 10) {
      AllocInternal(bool)::__executeCount = AllocInternal(bool)::__executeCount + 1;
      Warning("CUtlLinkedList overflow! (exhausted index range)\n");
    }
    return (int *)0x0;
  }
  *(int **)(this + 0x20) = piVar3;
  *(int *)(this + 0x24) = iVar6;
  piVar7 = piVar4;
  if (piVar3[1] <= iVar6) {
    piVar4 = (int *)0x0;
    piVar7 = piVar1;
  }
  *(int *)(this + 0x1c) = *(int *)(this + 0x1c) + 1;
joined_r0x001e362a:
  if (param_1) {
    piVar4[3] = 0;
    piVar4[2] = 0;
    return piVar7;
  }
  piVar4[3] = (int)piVar7;
  piVar4[2] = (int)piVar7;
  return piVar7;
}

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)