L L4D2node

CFrameSnapshotManager::TakeTickSnapshot

0x001f2710 · 597 bytes · __thiscall

_ZN21CFrameSnapshotManager16TakeTickSnapshotEi

Decompiled

undefined (2 params)

/* CFrameSnapshotManager::TakeTickSnapshot(int) */

int __thiscall CFrameSnapshotManager::TakeTickSnapshot(CFrameSnapshotManager *this,int param_1)

{
  int iVar1;
  char cVar2;
  int iVar3;
  int *piVar4;
  undefined4 uVar5;
  uint uVar6;
  void *pvVar7;
  int iVar8;
  byte *pbVar9;
  int iVar10;
  undefined4 *puVar11;
  undefined2 local_101c [2054];
  
  iVar3 = CreateEmptySnapshot(this,param_1,DAT_003b816c);
  iVar1 = DAT_003b8080;
  if (0 < DAT_003b816c) {
    iVar10 = 0;
    pbVar9 = (byte *)(DAT_003b8174 + -0x10);
    puVar11 = (undefined4 *)(*(int *)(iVar3 + 8) + -0xc);
    do {
      if ((*(int *)(pbVar9 + 0x1c) != 0) && ((pbVar9[0x10] & 2) == 0)) {
        if ((iVar10 <= iVar1) && (0 < iVar10)) {
          iVar8 = *(int *)(DAT_003b8074 + -4 + iVar10 * 4);
          piVar4 = (int *)(iVar8 + 4);
          if (iVar8 == 0) {
            piVar4 = (int *)0x0;
          }
          cVar2 = (**(code **)(*piVar4 + 0x88))(piVar4);
          if (cVar2 == '\0') goto LAB_001f27dd;
        }
        puVar11[4] = *(undefined4 *)(pbVar9 + 0x14);
        uVar5 = (**(code **)(**(int **)(pbVar9 + 0x18) + 4))(*(int **)(pbVar9 + 0x18));
        puVar11[3] = uVar5;
        iVar8 = *(int *)(iVar3 + 0x14);
        *(int *)(iVar3 + 0x14) = iVar8 + 1;
        local_101c[iVar8] = (short)iVar10;
      }
LAB_001f27dd:
      iVar10 = iVar10 + 1;
      pbVar9 = pbVar9 + 0x10;
      puVar11 = puVar11 + 3;
    } while (iVar10 < DAT_003b816c);
  }
  uVar6 = *(uint *)(iVar3 + 0x14) * 2;
  if (0x3f800000 < *(uint *)(iVar3 + 0x14)) {
    uVar6 = 0xffffffff;
  }
  pvVar7 = operator_new__(uVar6);
  *(void **)(iVar3 + 0x10) = pvVar7;
  _V_memcpy(pvVar7,local_101c,*(int *)(iVar3 + 0x14) * 2);
  if ((hltv != 0) && (cVar2 = (**(code **)(*(int *)(hltv + 4) + 0x58))(hltv + 4), cVar2 != '\0')) {
    uVar6 = 0xffffffff;
    if (*(uint *)(iVar3 + 0x14) < 0x7f00001) {
      uVar6 = *(uint *)(iVar3 + 0x14) << 4;
    }
    pvVar7 = operator_new__(uVar6);
    *(void **)(iVar3 + 0x18) = pvVar7;
    _V_memset(pvVar7,0,*(int *)(iVar3 + 0x14) << 4);
  }
  iVar1 = *(int *)(this + 0x40b0);
  iVar10 = *(int *)(this + 0x40a4);
  *(undefined4 *)(iVar3 + 0x30) = 0;
  if (iVar1 != 0) {
    CUtlVector<int,CUtlMemory<int,int>>::GrowVector
              ((CUtlVector<int,CUtlMemory<int,int>> *)(iVar3 + 0x24),iVar1);
    CUtlVector<int,CUtlMemory<int,int>>::ShiftElementsRight
              ((CUtlVector<int,CUtlMemory<int,int>> *)(iVar3 + 0x24),0,iVar1);
    if (0 < iVar1) {
      iVar8 = 0;
      do {
        *(undefined4 *)(*(int *)(iVar3 + 0x24) + iVar8) = *(undefined4 *)(iVar10 + iVar8);
        iVar8 = iVar8 + 4;
      } while (iVar8 != iVar1 << 2);
    }
  }
  *(undefined4 *)(this + 0x40b0) = 0;
  CUtlMemory<int,int>::Purge((CUtlMemory<int,int> *)(this + 0x40a4));
  *(undefined4 *)(this + 0x40b4) = *(undefined4 *)(this + 0x40a4);
  return iVar3;
}

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)