L L4D2node

CUtlVector<CTerrorPlayer*,CUtlMemoryFixedGrowable<CTerrorPlayer*,4u,int>>::InsertBefore

0x00a63e90 · 197 bytes · __thiscall

_ZN10CUtlVectorIP13CTerrorPlayer23CUtlMemoryFixedGrowableIS1_Lj4EiEE12InsertBeforeEiRKS1_

Decompiled

undefined (3 params)

/* CUtlVector<CTerrorPlayer*, CUtlMemoryFixedGrowable<CTerrorPlayer*, 4u, int> >::InsertBefore(int,
   CTerrorPlayer* const&) */

int __thiscall
CUtlVector<CTerrorPlayer*,CUtlMemoryFixedGrowable<CTerrorPlayer*,4u,int>>::InsertBefore
          (CUtlVector<CTerrorPlayer*,CUtlMemoryFixedGrowable<CTerrorPlayer*,4u,int>> *this,
          int param_1,CTerrorPlayer **param_2)

{
  int iVar1;
  int iVar2;
  void *__dest;
  int iVar3;
  
  iVar1 = *(int *)(this + 4);
  iVar2 = *(int *)(this + 0x20) + 1;
  if (iVar1 < iVar2) {
    if (*(int *)(this + 8) < 0) {
      *(undefined4 *)(this + 8) = *(undefined4 *)(this + 0xc);
      if (iVar1 == 0) {
        *(undefined4 *)this = 0;
      }
      else {
        __dest = malloc(iVar1 << 2);
        memcpy(__dest,*(void **)this,iVar1 << 2);
        *(void **)this = __dest;
      }
    }
    CUtlMemory<CTerrorPlayer*,int>::Grow((CUtlMemory<CTerrorPlayer*,int> *)this,iVar2 - iVar1);
    iVar2 = *(int *)(this + 0x20) + 1;
  }
  iVar3 = *(int *)this;
  *(int *)(this + 0x20) = iVar2;
  iVar1 = param_1 * 4;
  iVar2 = (iVar2 - param_1) + -1;
  *(int *)(this + 0x24) = iVar3;
  if (0 < iVar2) {
    _V_memmove((void *)(iVar3 + 4 + iVar1),(void *)(iVar3 + iVar1),iVar2 * 4);
    iVar3 = *(int *)this;
  }
  if ((undefined4 *)(iVar3 + iVar1) != (undefined4 *)0x0) {
    *(undefined4 *)(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)