L L4D2node

CUtlVector<unsigned_short,CUtlMemoryConservative<unsigned_short>>::InsertBefore

0x005bf530 · 132 bytes · __thiscall

_ZN10CUtlVectorIt22CUtlMemoryConservativeItEE12InsertBeforeEiRKt

Decompiled

undefined (3 params)

/* CUtlVector<unsigned short, CUtlMemoryConservative<unsigned short> >::InsertBefore(int, unsigned
   short const&) */

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

{
  int iVar1;
  void *pvVar2;
  int iVar3;
  
  iVar3 = *(int *)(this + 8) + 1;
  if ((int)(*(uint *)(this + 4) >> 1) < iVar3) {
    pvVar2 = realloc(*(void **)this,iVar3 * 2);
    *(int *)(this + 4) = iVar3 * 2;
    *(void **)this = pvVar2;
    iVar3 = *(int *)(this + 8) + 1;
  }
  else {
    pvVar2 = *(void **)this;
  }
  *(int *)(this + 8) = iVar3;
  iVar1 = param_1 * 2;
  iVar3 = (iVar3 - param_1) + -1;
  *(void **)(this + 0xc) = pvVar2;
  if (0 < iVar3) {
    _V_memmove((void *)((int)pvVar2 + iVar1 + 2),(void *)((int)pvVar2 + iVar1),iVar3 * 2);
    pvVar2 = *(void **)this;
  }
  if ((ushort *)((int)pvVar2 + iVar1) != (ushort *)0x0) {
    *(ushort *)((int)pvVar2 + 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)