L L4D2node

CUtlVector<CSceneManager::CRestoreSceneSound,CUtlMemory<CSceneManager::CRestoreSceneSound,int>>::InsertBefore

0x0081b630 · 288 bytes · __thiscall

_ZN10CUtlVectorIN13CSceneManager18CRestoreSceneSoundE10CUtlMemoryIS1_iEE12InsertBeforeEiRKS1_

Decompiled

undefined (3 params)

/* CUtlVector<CSceneManager::CRestoreSceneSound, CUtlMemory<CSceneManager::CRestoreSceneSound, int>
   >::InsertBefore(int, CSceneManager::CRestoreSceneSound const&) */

int __thiscall
CUtlVector<CSceneManager::CRestoreSceneSound,CUtlMemory<CSceneManager::CRestoreSceneSound,int>>::
InsertBefore(CUtlVector<CSceneManager::CRestoreSceneSound,CUtlMemory<CSceneManager::CRestoreSceneSound,int>>
             *this,int param_1,CRestoreSceneSound *param_2)

{
  undefined4 *puVar1;
  void *pvVar2;
  int iVar3;
  int iVar4;
  CRestoreSceneSound *pCVar5;
  int iVar6;
  undefined4 *puVar7;
  byte bVar8;
  
  bVar8 = 0;
  iVar6 = *(int *)(this + 4);
  iVar3 = *(int *)(this + 0xc) + 1;
  if (iVar6 < iVar3) {
    iVar4 = *(int *)(this + 8);
    if (-1 < iVar4) {
      if (iVar4 == 0) {
        if (iVar6 == 0) {
          if (iVar3 < 2) {
            iVar4 = 1;
            goto LAB_0081b6f7;
          }
          iVar6 = 1;
        }
        do {
          iVar4 = iVar6 * 2;
          if (iVar3 <= iVar4) break;
          iVar4 = iVar6 * 4;
          iVar6 = iVar4;
        } while (iVar4 < iVar3);
      }
      else {
        for (iVar4 = iVar4 * (*(int *)(this + 0xc) / iVar4 + 1); iVar4 < iVar3;
            iVar4 = (iVar4 + iVar3) / 2) {
        }
      }
LAB_0081b6f7:
      *(int *)(this + 4) = iVar4;
      if (*(void **)this == (void *)0x0) {
        pvVar2 = malloc(iVar4 * 0x8c);
        *(void **)this = pvVar2;
      }
      else {
        pvVar2 = realloc(*(void **)this,iVar4 * 0x8c);
        *(void **)this = pvVar2;
        iVar3 = *(int *)(this + 0xc) + 1;
      }
      goto LAB_0081b64e;
    }
  }
  pvVar2 = *(void **)this;
LAB_0081b64e:
  *(int *)(this + 0xc) = iVar3;
  *(void **)(this + 0x10) = pvVar2;
  iVar3 = (iVar3 - param_1) + -1;
  iVar6 = param_1 * 0x8c;
  if (0 < iVar3) {
    _V_memmove((void *)((int)pvVar2 + iVar6 + 0x8c),(void *)((int)pvVar2 + iVar6),iVar3 * 0x8c);
    pvVar2 = *(void **)this;
  }
  puVar1 = (undefined4 *)((int)pvVar2 + iVar6);
  if (puVar1 != (undefined4 *)0x0) {
    *puVar1 = *(undefined4 *)param_2;
    pCVar5 = param_2 + 4;
    puVar7 = puVar1 + 1;
    for (iVar3 = 0x20; iVar3 != 0; iVar3 = iVar3 + -1) {
      *puVar7 = *(undefined4 *)pCVar5;
      pCVar5 = pCVar5 + (uint)bVar8 * -8 + 4;
      puVar7 = puVar7 + (uint)bVar8 * -2 + 1;
    }
    puVar1[0x21] = *(undefined4 *)(param_2 + 0x84);
    puVar1[0x22] = *(undefined4 *)(param_2 + 0x88);
  }
  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)