L L4D2node

CUtlLinkedList<CAwardTemplate*,unsigned_short,false,unsigned_short,CUtlMemory<UtlLinkedListElem_t<CAwardTemplate*,unsigned_short>,unsigned_short>>::InsertBefore

0x00849df0 · 594 bytes · __thiscall

_ZN14CUtlLinkedListIP14CAwardTemplatetLb0Et10CUtlMemoryI19UtlLinkedListElem_tIS1_tEtEE12InsertBeforeEtRKS1_

Decompiled

undefined (3 params)

/* CUtlLinkedList<CAwardTemplate*, unsigned short, false, unsigned short,
   CUtlMemory<UtlLinkedListElem_t<CAwardTemplate*, unsigned short>, unsigned short>
   >::InsertBefore(unsigned short, CAwardTemplate* const&) */

uint __thiscall
CUtlLinkedList<CAwardTemplate*,unsigned_short,false,unsigned_short,CUtlMemory<UtlLinkedListElem_t<CAwardTemplate*,unsigned_short>,unsigned_short>>
::InsertBefore(CUtlLinkedList<CAwardTemplate*,unsigned_short,false,unsigned_short,CUtlMemory<UtlLinkedListElem_t<CAwardTemplate*,unsigned_short>,unsigned_short>>
               *this,ushort param_1,CAwardTemplate **param_2)

{
  int iVar1;
  ushort uVar2;
  uint uVar3;
  int iVar4;
  uint uVar5;
  ushort uVar6;
  uint uVar7;
  uint uVar8;
  uint uVar9;
  int local_20;
  
  uVar6 = *(ushort *)(this + 0x10);
  uVar7 = (uint)uVar6;
  uVar3 = uVar7;
  if (uVar6 == 0xffff) {
    iVar4 = *(int *)(this + 4);
    if ((int)(uint)*(ushort *)(this + 0x16) < iVar4) {
      uVar8 = *(ushort *)(this + 0x16) + 1;
      uVar5 = 0xffff;
      uVar9 = uVar8 & 0xffff;
      if ((int)uVar9 < iVar4) {
        uVar3 = uVar8;
        uVar5 = uVar9;
      }
    }
    else {
      uVar5 = 0;
      if (iVar4 < 1) {
        uVar5 = 0xffff;
      }
      uVar3 = (0 < iVar4) - 1;
    }
    if (iVar4 <= (int)uVar5) {
      CUtlMemory<UtlLinkedListElem_t<CAwardTemplate*,unsigned_short>,unsigned_short>::Grow
                ((CUtlMemory<UtlLinkedListElem_t<CAwardTemplate*,unsigned_short>,unsigned_short> *)
                 this,1);
      *(undefined4 *)(this + 0x18) = *(undefined4 *)this;
      iVar4 = *(int *)(this + 4);
      if ((int)(uint)*(ushort *)(this + 0x16) < iVar4) {
        uVar8 = *(ushort *)(this + 0x16) + 1;
        uVar5 = uVar8 & 0xffff;
        uVar3 = uVar7;
        uVar7 = 0xffff;
        if ((int)uVar5 < iVar4) {
          uVar3 = uVar8;
          uVar7 = uVar5;
        }
      }
      else {
        uVar7 = 0;
        if (iVar4 < 1) {
          uVar7 = 0xffff;
        }
        uVar3 = (0 < iVar4) - 1;
      }
      if (iVar4 <= (int)uVar7) {
        if (9 < AllocInternal(bool)::__executeCount) {
          return 0xffffffff;
        }
        AllocInternal(bool)::__executeCount = AllocInternal(bool)::__executeCount + 1;
        Warning("CUtlLinkedList overflow! (exhausted memory allocator)\n");
        return 0xffffffff;
      }
    }
    if ((short)uVar3 == -1) {
      if (AllocInternal(bool)::__executeCount < 10) {
        AllocInternal(bool)::__executeCount = AllocInternal(bool)::__executeCount + 1;
        Warning("CUtlLinkedList overflow! (exhausted index range)\n");
      }
      return 0xffffffff;
    }
    uVar7 = uVar3 & 0xffff;
    *(short *)(this + 0x16) = (short)uVar3;
    *(short *)(this + 0x14) = *(short *)(this + 0x14) + 1;
    local_20 = uVar7 * 8;
    iVar4 = *(int *)this + local_20;
  }
  else {
    uVar7 = (uint)uVar6;
    local_20 = uVar7 * 8;
    iVar4 = *(int *)this + local_20;
    *(undefined2 *)(this + 0x10) = *(undefined2 *)(iVar4 + 6);
  }
  uVar6 = (ushort)uVar3;
  *(ushort *)(iVar4 + 6) = uVar6;
  *(ushort *)(*(int *)this + 4 + local_20) = uVar6;
  if (((int)uVar7 < *(int *)(this + 4)) && (uVar6 <= *(ushort *)(this + 0x16))) {
    iVar4 = *(int *)this + local_20;
    uVar2 = *(ushort *)(iVar4 + 4);
    if (uVar6 != uVar2) {
      if (uVar2 == 0xffff) {
        *(undefined2 *)(this + 0xc) = *(undefined2 *)(iVar4 + 6);
      }
      else {
        *(undefined2 *)(*(int *)this + 6 + (uint)uVar2 * 8) = *(undefined2 *)(iVar4 + 6);
      }
      if (*(ushort *)(iVar4 + 6) == 0xffff) {
        *(undefined2 *)(this + 0xe) = *(undefined2 *)(iVar4 + 4);
      }
      else {
        *(undefined2 *)(*(int *)this + 4 + (uint)*(ushort *)(iVar4 + 6) * 8) =
             *(undefined2 *)(iVar4 + 4);
      }
      *(ushort *)(iVar4 + 6) = uVar6;
      *(ushort *)(iVar4 + 4) = uVar6;
      *(short *)(this + 0x12) = *(short *)(this + 0x12) + -1;
    }
  }
  iVar4 = local_20 + *(int *)this;
  *(ushort *)(iVar4 + 6) = param_1;
  if (param_1 == 0xffff) {
    uVar2 = *(ushort *)(this + 0xe);
    *(ushort *)(iVar4 + 4) = uVar2;
    *(ushort *)(this + 0xe) = uVar6;
  }
  else {
    iVar1 = *(int *)this + (uint)param_1 * 8;
    uVar2 = *(ushort *)(iVar1 + 4);
    *(ushort *)(iVar4 + 4) = uVar2;
    *(ushort *)(iVar1 + 4) = uVar6;
  }
  if (uVar2 == 0xffff) {
    *(ushort *)(this + 0xc) = uVar6;
  }
  else {
    *(ushort *)(*(int *)this + 6 + (uint)uVar2 * 8) = uVar6;
  }
  *(short *)(this + 0x12) = *(short *)(this + 0x12) + 1;
  if ((undefined4 *)(local_20 + *(int *)this) != (undefined4 *)0x0) {
    *(undefined4 *)(local_20 + *(int *)this) = *param_2;
  }
  return uVar3;
}

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)