L L4D2node

CUtlVector<GCSDK::CJobMgr::JobSleeping_t,CUtlMemory<GCSDK::CJobMgr::JobSleeping_t,int>>::InsertBefore

0x00063a30 · 263 bytes · __thiscall

_ZN10CUtlVectorIN5GCSDK7CJobMgr13JobSleeping_tE10CUtlMemoryIS2_iEE12InsertBeforeEi

Decompiled

undefined (2 params)

/* CUtlVector<GCSDK::CJobMgr::JobSleeping_t, CUtlMemory<GCSDK::CJobMgr::JobSleeping_t, int>
   >::InsertBefore(int) */

int __thiscall
CUtlVector<GCSDK::CJobMgr::JobSleeping_t,CUtlMemory<GCSDK::CJobMgr::JobSleeping_t,int>>::
InsertBefore(CUtlVector<GCSDK::CJobMgr::JobSleeping_t,CUtlMemory<GCSDK::CJobMgr::JobSleeping_t,int>>
             *this,int param_1)

{
  int iVar1;
  int iVar2;
  int iVar3;
  void *pvVar4;
  
  iVar3 = *(int *)(this + 4);
  iVar2 = *(int *)(this + 0xc) + 1;
  if (iVar3 < iVar2) {
    iVar1 = *(int *)(this + 8);
    if (-1 < iVar1) {
      if (iVar1 == 0) {
        if (iVar3 == 0) {
          if (iVar2 < 3) {
            iVar1 = 2;
            goto LAB_00063adf;
          }
          iVar3 = 2;
        }
        do {
          iVar1 = iVar3 * 2;
          if (iVar2 <= iVar1) break;
          iVar1 = iVar3 * 4;
          iVar3 = iVar1;
        } while (iVar1 < iVar2);
      }
      else {
        for (iVar1 = iVar1 * (*(int *)(this + 0xc) / iVar1 + 1); iVar1 < iVar2;
            iVar1 = (iVar1 + iVar2) / 2) {
        }
      }
LAB_00063adf:
      *(int *)(this + 4) = iVar1;
      if (*(void **)this == (void *)0x0) {
        pvVar4 = malloc(iVar1 * 0x18);
        *(void **)this = pvVar4;
      }
      else {
        pvVar4 = realloc(*(void **)this,iVar1 * 0x18);
        *(void **)this = pvVar4;
        iVar2 = *(int *)(this + 0xc) + 1;
      }
      goto LAB_00063a4e;
    }
  }
  pvVar4 = *(void **)this;
LAB_00063a4e:
  *(int *)(this + 0xc) = iVar2;
  iVar2 = (iVar2 - param_1) + -1;
  *(void **)(this + 0x10) = pvVar4;
  iVar3 = param_1 * 0x18;
  if (0 < iVar2) {
    _V_memmove((void *)((int)pvVar4 + iVar3 + 0x18),(void *)((int)pvVar4 + iVar3),iVar2 * 0x18);
    pvVar4 = *(void **)this;
  }
  pvVar4 = (void *)(iVar3 + (int)pvVar4);
  if (pvVar4 != (void *)0x0) {
    GCSDK::CJobTime::CJobTime((CJobTime *)((int)pvVar4 + 8));
    GCSDK::CJobTime::CJobTime((CJobTime *)((int)pvVar4 + 0x10));
  }
  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)