L L4D2node

CUtlVector<unsigned_short,CUtlMemoryFixedGrowable<unsigned_short,64u,int>>::InsertBefore

0x00120940 · 151 bytes · __thiscall

_ZN10CUtlVectorIt23CUtlMemoryFixedGrowableItLj64EiEE12InsertBeforeEiRKt

Decompiled

undefined (3 params)

/* CUtlVector<unsigned short, CUtlMemoryFixedGrowable<unsigned short, 64u, int> >::InsertBefore(int,
   unsigned short const&) */

int __thiscall
CUtlVector<unsigned_short,CUtlMemoryFixedGrowable<unsigned_short,64u,int>>::InsertBefore
          (CUtlVector<unsigned_short,CUtlMemoryFixedGrowable<unsigned_short,64u,int>> *this,
          int param_1,ushort *param_2)

{
  int iVar1;
  int iVar2;
  int iVar3;
  CUtlMemory<unsigned_short,int> *in_stack_ffffffd4;
  int in_stack_ffffffd8;
  
  iVar3 = *(int *)(this + 4);
  iVar2 = *(int *)(this + 0x90) + 1;
  if (iVar3 < iVar2) {
    if (*(int *)(this + 8) < 0) {
      CUtlMemory<unsigned_short,int>::ConvertToGrowableMemory(in_stack_ffffffd4,in_stack_ffffffd8);
    }
    CUtlMemory<unsigned_short,int>::Grow((CUtlMemory<unsigned_short,int> *)this,iVar2 - iVar3);
    iVar2 = *(int *)(this + 0x90) + 1;
  }
  iVar3 = *(int *)this;
  *(int *)(this + 0x90) = iVar2;
  iVar1 = param_1 * 2;
  iVar2 = (iVar2 - param_1) + -1;
  *(int *)(this + 0x94) = iVar3;
  if (0 < iVar2) {
    _V_memmove((void *)(iVar3 + 2 + iVar1),(void *)(iVar3 + iVar1),iVar2 * 2);
    iVar3 = *(int *)this;
  }
  if ((ushort *)(iVar3 + iVar1) != (ushort *)0x0) {
    *(ushort *)(iVar3 + iVar1) = *param_2;
  }
  return param_1;
}

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)