L L4D2node

CHLTVServer::GetDeltaFrame

0x00172140 · 454 bytes · __thiscall

_ZN11CHLTVServer13GetDeltaFrameEi

Decompiled

undefined (2 params)

/* CHLTVServer::GetDeltaFrame(int) */

undefined4 __thiscall CHLTVServer::GetDeltaFrame(CHLTVServer *this,int param_1)

{
  int iVar1;
  undefined4 *puVar2;
  int iVar3;
  undefined4 uVar4;
  int iVar5;
  undefined4 *__ptr;
  int iVar6;
  
  if (*(int *)(tv_deltacache._28_4_ + 0x30) == 0) {
    uVar4 = CClientFrameManager::GetClientFrame((CClientFrameManager *)(this + 0x1cc),param_1,true);
    return uVar4;
  }
  iVar1 = *(int *)(this + 0x83f8);
  if (iVar1 < 1) {
    __ptr = *(undefined4 **)(this + 0x83ec);
  }
  else {
    __ptr = *(undefined4 **)(this + 0x83ec);
    iVar3 = 0;
    iVar6 = __ptr[1];
    puVar2 = __ptr;
    while( true ) {
      if (param_1 == iVar6) {
        return *puVar2;
      }
      iVar3 = iVar3 + 1;
      if (iVar3 == iVar1) break;
      iVar6 = puVar2[3];
      puVar2 = puVar2 + 2;
    }
  }
  iVar6 = iVar1 + 1;
  iVar3 = *(int *)(this + 0x83f0);
  if (iVar6 <= iVar3) goto LAB_001721b1;
  iVar5 = *(int *)(this + 0x83f4);
  if (iVar5 < 0) goto LAB_001721b1;
  if (iVar5 == 0) {
    if (iVar3 == 0) {
      if (iVar6 < 5) {
        iVar5 = 4;
        goto LAB_0017228f;
      }
      iVar3 = 4;
    }
    do {
      iVar5 = iVar3 * 2;
      if (iVar6 <= iVar5) break;
      iVar5 = iVar3 * 4;
      iVar3 = iVar5;
    } while (iVar5 < iVar6);
  }
  else {
    for (iVar5 = (iVar1 / iVar5 + 1) * iVar5; iVar5 < iVar6; iVar5 = (iVar5 + iVar6) / 2) {
    }
  }
LAB_0017228f:
  *(int *)(this + 0x83f0) = iVar5;
  if (__ptr == (undefined4 *)0x0) {
    __ptr = malloc(iVar5 << 3);
    *(undefined4 **)(this + 0x83ec) = __ptr;
  }
  else {
    __ptr = realloc(__ptr,iVar5 << 3);
    *(undefined4 **)(this + 0x83ec) = __ptr;
    iVar6 = *(int *)(this + 0x83f8) + 1;
  }
LAB_001721b1:
  *(int *)(this + 0x83f8) = iVar6;
  iVar6 = (iVar6 - iVar1) + -1;
  *(undefined4 **)(this + 0x83fc) = __ptr;
  if (0 < iVar6) {
    _V_memmove(__ptr + iVar1 * 2 + 2,__ptr + iVar1 * 2,iVar6 * 8);
    __ptr = *(undefined4 **)(this + 0x83ec);
  }
  (__ptr + iVar1 * 2)[1] = param_1;
  uVar4 = CClientFrameManager::GetClientFrame((CClientFrameManager *)(this + 0x1cc),param_1,true);
  __ptr[iVar1 * 2] = uVar4;
  return uVar4;
}

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)