L L4D2node

CHLTVClientState::ReadDeltaEnt

0x0016ae00 · 989 bytes · __thiscall

_ZN16CHLTVClientState12ReadDeltaEntER15CEntityReadInfo

Decompiled

undefined (2 params)

/* CHLTVClientState::ReadDeltaEnt(CEntityReadInfo&) */

void __thiscall CHLTVClientState::ReadDeltaEnt(CHLTVClientState *this,CEntityReadInfo *param_1)

{
  uint *puVar1;
  CFrameSnapshot *pCVar2;
  CFrameSnapshot *pCVar3;
  int iVar4;
  int iVar5;
  PackedEntity *this_00;
  PackedEntity *pPVar6;
  undefined4 uVar7;
  int iVar8;
  int iVar9;
  void *pvVar10;
  uint uVar11;
  uint uVar12;
  int in_GS_OFFSET;
  int *local_8074;
  int local_8064;
  int local_8060;
  char *local_805c [3];
  int local_8050;
  char *local_8044;
  undefined1 local_8040;
  undefined4 local_803c;
  undefined4 local_8038;
  int local_8020 [4096];
  undefined1 local_4020 [16384];
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  iVar9 = *(int *)(param_1 + 0x18);
  pCVar2 = *(CFrameSnapshot **)(*(int *)(param_1 + 8) + 0x118);
  pCVar3 = *(CFrameSnapshot **)(*(int *)(param_1 + 0xc) + 0x118);
  iVar8 = *(int *)(pCVar3 + 8);
  iVar4 = *(int *)(pCVar2 + 8);
  iVar5 = iVar9 * 0xc;
  *(undefined4 *)(iVar8 + iVar5) = *(undefined4 *)(iVar4 + iVar5);
  *(undefined4 *)(iVar8 + 4 + iVar5) = *(undefined4 *)(iVar4 + 4 + iVar5);
  *(undefined4 *)(iVar8 + 8 + iVar5) = *(undefined4 *)(iVar4 + 8 + iVar5);
  this_00 = (PackedEntity *)
            CFrameSnapshotManager::CreatePackedEntity
                      ((CFrameSnapshotManager *)framesnapshotmanager,pCVar3,iVar9);
  pPVar6 = (PackedEntity *)
           CFrameSnapshotManager::GetPackedEntity
                     ((CFrameSnapshotManager *)framesnapshotmanager,pCVar2,iVar9);
  PackedEntity::SetServerAndClientClass
            (this_00,*(ServerClass **)pPVar6,*(ClientClass **)(pPVar6 + 4));
  local_8074 = (int *)0x0;
  if (this[0x49e4] == (CHLTVClientState)0x0) {
    local_8074 = (int *)(**(code **)(**(int **)(pPVar6 + 0x2c) + 0x10))(*(int **)(pPVar6 + 0x2c));
    *(int **)(this_00 + 0x2c) = local_8074;
    iVar9 = *(int *)(pPVar6 + 0x28);
    if (-1 < iVar9) goto LAB_0016aee0;
LAB_0016b18f:
    pvVar10 = (void *)CBaseServer::UncompressPackedEntity
                                ((CBaseServer *)(*(int *)(this + 0x49ec) + 4),pPVar6,&local_8064);
  }
  else {
    iVar9 = *(int *)(pPVar6 + 0x28);
    if (iVar9 < 0) goto LAB_0016b18f;
LAB_0016aee0:
    pvVar10 = *(void **)(pPVar6 + 0x24);
    local_8064 = iVar9;
  }
  local_8040 = 0;
  local_803c = 0xffffffff;
  local_8038 = 0;
  local_8044 = "HLTV_ReadEnterPVS1";
  CBitRead::StartReading((CBitRead *)&local_8044,pvVar10,local_8064 + 7 >> 3,0,local_8064);
  bf_write::bf_write((bf_write *)local_805c,"HLTV_ReadEnterPVS2",local_4020,0x4000,-1);
  uVar7 = RecvTable_MergeDeltas
                    (*(RecvTable **)(*(int *)(this_00 + 4) + 0xc),(bf_read *)&local_8044,
                     *(bf_read **)(param_1 + 0x2c),(bf_write *)local_805c,-1,local_8020,false);
  if (local_8074 != (int *)0x0) {
    (**(code **)(*local_8074 + 8))(local_8074,local_8020,uVar7,*(undefined4 *)(pCVar3 + 4));
  }
  if (this[0x49e4] == (CHLTVClientState)0x0) {
    PackedEntity::AllocAndCopyPadded(this_00,local_4020,local_8050 + 7 >> 3);
  }
  else {
    local_8060 = local_8050;
    pvVar10 = (void *)CBaseServer::CompressPackedEntity
                                ((CBaseServer *)(*(int *)(this + 0x49ec) + 4),
                                 *(ServerClass **)this_00,local_805c[0],&local_8060);
    PackedEntity::AllocAndCopyPadded(this_00,pvVar10,local_8060 + 7 >> 3);
    *(uint *)(this_00 + 0x28) = *(uint *)(this_00 + 0x28) | 0x80000000;
  }
  *(undefined4 *)(*(int *)(param_1 + 0xc) + 4) = *(undefined4 *)(param_1 + 0x18);
  puVar1 = (uint *)(*(int *)(param_1 + 0xc) + 0xc + (*(int *)(param_1 + 0x18) >> 5) * 4);
  *puVar1 = *puVar1 | 1 << ((byte)*(int *)(param_1 + 0x18) & 0x1f);
  if ((*(int *)(param_1 + 8) != 0) && (uVar12 = *(int *)(param_1 + 0x14) + 1, (int)uVar12 < 0x800))
  {
    iVar8 = (int)uVar12 >> 5;
    puVar1 = (uint *)(*(int *)(param_1 + 8) + 0xc + iVar8 * 4);
    uVar12 = *puVar1 & (&GetStartBitMask(int)::g_StartMask)[uVar12 & 0x1f];
    iVar9 = iVar8;
    if (uVar12 == 0) {
      uVar12 = puVar1[1];
      iVar4 = iVar8;
      while (iVar9 = iVar4 + 1, iVar9 != 0x40) {
        if (uVar12 != 0) goto LAB_0016b098;
        uVar12 = puVar1[(iVar4 + 2) - iVar8];
        iVar4 = iVar9;
      }
    }
    else {
LAB_0016b098:
      iVar9 = iVar9 * 0x20;
      if ((uVar12 & 0xff) == 0) {
        uVar11 = uVar12 >> 8 & 0xff;
        if (uVar11 == 0) {
          uVar11 = uVar12 >> 0x10 & 0xff;
          if (uVar11 == 0) {
            if (uVar12 >> 0x18 == 0) goto LAB_0016b0e0;
            iVar9 = iVar9 + 0x18 +
                    *(int *)(FirstBitInWord(unsigned_int,int)::firstBitLUT + (uVar12 >> 0x18) * 4);
          }
          else {
            iVar9 = iVar9 + 0x10 +
                    *(int *)(FirstBitInWord(unsigned_int,int)::firstBitLUT + uVar11 * 4);
          }
        }
        else {
          iVar9 = iVar9 + 8 + *(int *)(FirstBitInWord(unsigned_int,int)::firstBitLUT + uVar11 * 4);
        }
      }
      else {
        iVar9 = iVar9 + *(int *)(FirstBitInWord(unsigned_int,int)::firstBitLUT + (uVar12 & 0xff) * 4
                                );
      }
      *(int *)(param_1 + 0x14) = iVar9;
      if (-1 < iVar9) goto LAB_0016b0e7;
    }
  }
LAB_0016b0e0:
  *(undefined4 *)(param_1 + 0x14) = 9999;
LAB_0016b0e7:
  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
                    /* WARNING: Subroutine does not return */
    __stack_chk_fail();
  }
  return;
}

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)