L L4D2node

CUtlLinkedList<VisCacheEntry,unsigned_short,false,unsigned_short,CUtlMemory<UtlLinkedListElem_t<VisCacheEntry,unsigned_short>,unsigned_short>>::InsertAfter

0x001a2120 · 482 bytes · __thiscall

_ZN14CUtlLinkedListI13VisCacheEntrytLb0Et10CUtlMemoryI19UtlLinkedListElem_tIS0_tEtEE11InsertAfterEt

Decompiled

undefined (2 params)

/* CUtlLinkedList<VisCacheEntry, unsigned short, false, unsigned short,
   CUtlMemory<UtlLinkedListElem_t<VisCacheEntry, unsigned short>, unsigned short>
   >::InsertAfter(unsigned short) */

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

{
  ushort uVar1;
  int iVar2;
  uint uVar3;
  uint uVar4;
  uint uVar5;
  uint uVar6;
  int iVar7;
  undefined4 *puVar8;
  uint uVar9;
  
  uVar1 = *(ushort *)(this + 0x10);
  uVar6 = (uint)uVar1;
  uVar5 = uVar6;
  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<VisCacheEntry,unsigned_short>,unsigned_short>::Grow
                ((CUtlMemory<UtlLinkedListElem_t<VisCacheEntry,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 = uVar6;
        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;
    }
    uVar6 = uVar5 & 0xffff;
    *(short *)(this + 0x16) = (short)uVar5;
    *(short *)(this + 0x14) = *(short *)(this + 0x14) + 1;
    iVar7 = uVar6 * 0xb0;
    iVar2 = *(int *)this + iVar7;
  }
  else {
    uVar6 = (uint)uVar1;
    iVar7 = uVar6 * 0xb0;
    iVar2 = *(int *)this + iVar7;
    *(undefined2 *)(this + 0x10) = *(undefined2 *)(iVar2 + 0xae);
  }
  *(short *)(iVar2 + 0xae) = (short)uVar5;
  *(short *)(*(int *)this + 0xac + iVar7) = (short)uVar5;
  LinkAfter(this,param_1,(ushort)uVar6);
  puVar8 = (undefined4 *)(iVar7 + *(int *)this);
  if (puVar8 != (undefined4 *)0x0) {
    puVar8[0x21] = 0;
    puVar8[0x22] = 0;
    puVar8[0x23] = 0;
    puVar8[0x24] = 0;
    puVar8[0x25] = 0;
    puVar8[0x26] = 0;
    puVar8[0x27] = 0;
    puVar8[0x28] = 0;
    puVar8[0x29] = 0;
    puVar8[0x2a] = 0;
    *puVar8 = 0;
  }
  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)