L L4D2node

CUtlLinkedList<COverlayMgr::RenderQueueHead_t,unsigned_short,false,unsigned_short,CUtlMemory<UtlLinkedListElem_t<COverlayMgr::RenderQueueHead_t,unsigned_short>,unsigned_short>>::InsertBefore

0x001d5b90 · 462 bytes · __thiscall

_ZN14CUtlLinkedListIN11COverlayMgr17RenderQueueHead_tEtLb0Et10CUtlMemoryI19UtlLinkedListElem_tIS1_tEtEE12InsertBeforeEt

Decompiled

undefined (2 params)

/* CUtlLinkedList<COverlayMgr::RenderQueueHead_t, unsigned short, false, unsigned short,
   CUtlMemory<UtlLinkedListElem_t<COverlayMgr::RenderQueueHead_t, unsigned short>, unsigned short>
   >::InsertBefore(unsigned short) */

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

{
  ushort uVar1;
  int iVar2;
  uint uVar3;
  uint uVar4;
  uint uVar5;
  undefined2 uVar6;
  uint uVar7;
  int iVar8;
  uint uVar9;
  
  uVar1 = *(ushort *)(this + 0x10);
  uVar7 = (uint)uVar1;
  uVar5 = uVar7;
  if (uVar1 == 0xffff) {
    iVar2 = *(int *)(this + 4);
    if ((int)(uint)*(ushort *)(this + 0x16) < iVar2) {
      uVar4 = *(ushort *)(this + 0x16) + 1;
      uVar3 = 0xffff;
      uVar9 = uVar4 & 0xffff;
      if ((int)uVar9 < iVar2) {
        uVar3 = uVar9;
        uVar5 = uVar4;
      }
    }
    else {
      uVar3 = 0;
      if (iVar2 < 1) {
        uVar3 = 0xffff;
      }
      uVar5 = (0 < iVar2) - 1;
    }
    if (iVar2 <= (int)uVar3) {
      CUtlMemory<UtlLinkedListElem_t<COverlayMgr::RenderQueueHead_t,unsigned_short>,unsigned_short>
      ::Grow((CUtlMemory<UtlLinkedListElem_t<COverlayMgr::RenderQueueHead_t,unsigned_short>,unsigned_short>
              *)this,1);
      *(undefined4 *)(this + 0x18) = *(undefined4 *)this;
      iVar2 = *(int *)(this + 4);
      if ((int)(uint)*(ushort *)(this + 0x16) < iVar2) {
        uVar9 = *(ushort *)(this + 0x16) + 1;
        uVar4 = uVar9 & 0xffff;
        uVar3 = 0xffff;
        uVar5 = uVar7;
        if ((int)uVar4 < iVar2) {
          uVar3 = uVar4;
          uVar5 = uVar9;
        }
      }
      else {
        uVar3 = 0;
        if (iVar2 < 1) {
          uVar3 = 0xffff;
        }
        uVar5 = (0 < iVar2) - 1;
      }
      if (iVar2 <= (int)uVar3) {
        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)uVar5 == -1) {
      if (AllocInternal(bool)::__executeCount < 10) {
        AllocInternal(bool)::__executeCount = AllocInternal(bool)::__executeCount + 1;
        Warning("CUtlLinkedList overflow! (exhausted index range)\n");
      }
      return 0xffffffff;
    }
    uVar7 = uVar5 & 0xffff;
    *(short *)(this + 0x16) = (short)uVar5;
    *(short *)(this + 0x14) = *(short *)(this + 0x14) + 1;
    iVar8 = uVar7 * 0x30;
    iVar2 = *(int *)this + iVar8;
  }
  else {
    uVar7 = (uint)uVar1;
    iVar8 = uVar7 * 0x30;
    iVar2 = *(int *)this + iVar8;
    *(undefined2 *)(this + 0x10) = *(undefined2 *)(iVar2 + 0x2e);
  }
  uVar6 = (undefined2)uVar5;
  *(undefined2 *)(iVar2 + 0x2e) = uVar6;
  *(undefined2 *)(*(int *)this + 0x2c + iVar8) = uVar6;
  Unlink(this,(ushort)uVar7);
  iVar8 = iVar8 + *(int *)this;
  *(ushort *)(iVar8 + 0x2e) = param_1;
  if (param_1 == 0xffff) {
    uVar1 = *(ushort *)(this + 0xe);
    *(ushort *)(iVar8 + 0x2c) = uVar1;
    *(undefined2 *)(this + 0xe) = uVar6;
  }
  else {
    iVar2 = (uint)param_1 * 0x30 + *(int *)this;
    uVar1 = *(ushort *)(iVar2 + 0x2c);
    *(ushort *)(iVar8 + 0x2c) = uVar1;
    *(undefined2 *)(iVar2 + 0x2c) = uVar6;
  }
  if (uVar1 == 0xffff) {
    *(undefined2 *)(this + 0xc) = uVar6;
  }
  else {
    *(undefined2 *)((uint)uVar1 * 0x30 + *(int *)this + 0x2e) = uVar6;
  }
  *(short *)(this + 0x12) = *(short *)(this + 0x12) + 1;
  return uVar5;
}

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)