L L4D2node

CUtlLinkedList<CUtlBuffer,unsigned_short,false,unsigned_short,CUtlMemory<UtlLinkedListElem_t<CUtlBuffer,unsigned_short>,unsigned_short>>::InsertBefore

0x0020cb90 · 206 bytes · __thiscall

_ZN14CUtlLinkedListI10CUtlBuffertLb0Et10CUtlMemoryI19UtlLinkedListElem_tIS0_tEtEE12InsertBeforeEt

Decompiled

undefined (2 params)

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

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

{
  ushort uVar1;
  ushort uVar2;
  uint uVar3;
  int iVar4;
  CUtlBuffer *this_00;
  int iVar5;
  int iVar6;
  
  uVar3 = AllocInternal(this,false);
  uVar2 = (ushort)uVar3;
  if (uVar2 != 0xffff) {
    Unlink(this,uVar2);
    iVar4 = (uVar3 & 0xffff) * 0x3c;
    iVar5 = *(int *)this + iVar4;
    *(ushort *)(iVar5 + 0x3a) = param_1;
    if (param_1 == 0xffff) {
      uVar1 = *(ushort *)(this + 0xe);
      *(ushort *)(iVar5 + 0x38) = uVar1;
      *(ushort *)(this + 0xe) = uVar2;
    }
    else {
      iVar6 = (uint)param_1 * 0x3c + *(int *)this;
      uVar1 = *(ushort *)(iVar6 + 0x38);
      *(ushort *)(iVar5 + 0x38) = uVar1;
      *(ushort *)(iVar6 + 0x38) = uVar2;
    }
    if (uVar1 == 0xffff) {
      *(ushort *)(this + 0xc) = uVar2;
    }
    else {
      *(ushort *)((uint)uVar1 * 0x3c + *(int *)this + 0x3a) = uVar2;
    }
    *(short *)(this + 0x12) = *(short *)(this + 0x12) + 1;
    this_00 = (CUtlBuffer *)(iVar4 + *(int *)this);
    if (this_00 != (CUtlBuffer *)0x0) {
      CUtlBuffer::CUtlBuffer(this_00,0,0,0);
    }
    return uVar3;
  }
  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)