L L4D2node

CUtlVector<rr2::CriterionDynamic,CUtlMemoryConservative<rr2::CriterionDynamic>>::InsertBefore

0x00bdb300 · 223 bytes · __thiscall

_ZN10CUtlVectorIN3rr216CriterionDynamicE22CUtlMemoryConservativeIS1_EE12InsertBeforeEiRKS1_

Decompiled

undefined (3 params)

/* CUtlVector<rr2::CriterionDynamic, CUtlMemoryConservative<rr2::CriterionDynamic>
   >::InsertBefore(int, rr2::CriterionDynamic const&) */

int __thiscall
CUtlVector<rr2::CriterionDynamic,CUtlMemoryConservative<rr2::CriterionDynamic>>::InsertBefore
          (CUtlVector<rr2::CriterionDynamic,CUtlMemoryConservative<rr2::CriterionDynamic>> *this,
          int param_1,CriterionDynamic *param_2)

{
  byte bVar1;
  CriterionDynamic CVar2;
  undefined4 uVar3;
  undefined2 *puVar4;
  void *pvVar5;
  int iVar6;
  int iVar7;
  
  iVar6 = *(int *)(this + 8) + 1;
  if ((int)(*(uint *)(this + 4) / 0x14) < iVar6) {
    pvVar5 = realloc(*(void **)this,iVar6 * 0x14);
    *(void **)this = pvVar5;
    *(int *)(this + 4) = iVar6 * 0x14;
    iVar6 = *(int *)(this + 8) + 1;
  }
  else {
    pvVar5 = *(void **)this;
  }
  *(int *)(this + 8) = iVar6;
  iVar6 = (iVar6 - param_1) + -1;
  iVar7 = param_1 * 0x14;
  *(void **)(this + 0xc) = pvVar5;
  if (0 < iVar6) {
    _V_memmove((void *)((int)pvVar5 + iVar7 + 0x14),(void *)((int)pvVar5 + iVar7),iVar6 * 0x14);
    pvVar5 = *(void **)this;
  }
  puVar4 = (undefined2 *)((int)pvVar5 + iVar7);
  if (puVar4 != (undefined2 *)0x0) {
    *puVar4 = *(undefined2 *)param_2;
    bVar1 = *(byte *)(puVar4 + 4);
    *(undefined4 *)(puVar4 + 2) = *(undefined4 *)(param_2 + 4);
    CVar2 = param_2[8];
    *(byte *)(puVar4 + 4) = bVar1 & 0xfe | (byte)CVar2 & 1;
    *(byte *)(puVar4 + 4) = bVar1 & 0xfc | (byte)CVar2 & 1 | (byte)param_2[8] & 2;
    uVar3 = *(undefined4 *)(param_2 + 0x10);
    *(undefined4 *)(puVar4 + 6) = *(undefined4 *)(param_2 + 0xc);
    *(undefined4 *)(puVar4 + 8) = uVar3;
  }
  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)