L L4D2node

RecvTable_Decode_Guts<true>

0x00151d80 · 675 bytes · __cdecl

_Z21RecvTable_Decode_GutsILb1EEbP9RecvTablePvP7bf_readi

Decompiled

bool (4 params)

/* bool RecvTable_Decode_Guts<true>(RecvTable*, void*, bf_read*, int) */

bool RecvTable_Decode_Guts<true>(RecvTable *param_1,void *param_2,bf_read *param_3,int param_4)

{
  int iVar1;
  bf_read bVar2;
  CRecvDecoder *pCVar3;
  int iVar4;
  byte *pbVar5;
  int iVar6;
  int in_GS_OFFSET;
  int local_388;
  int local_384;
  CDeltaBitsReader local_37c [16];
  undefined **local_36c;
  int local_368;
  int aiStack_364 [65];
  int local_260;
  undefined4 local_25c;
  CRecvDecoder *local_250;
  int local_24c [4];
  undefined4 local_23c;
  int local_234;
  int local_230;
  int local_22c;
  int local_228;
  bf_read *local_224;
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  pCVar3 = *(CRecvDecoder **)(param_1 + 8);
  if (pCVar3 == (CRecvDecoder *)0x0) {
    Error("RecvTable_Decode: table \'%s\' missing a decoder.",*(undefined4 *)(param_1 + 0xc));
  }
  CDatatableStack::CDatatableStack
            ((CDatatableStack *)&local_36c,(CSendTablePrecalc *)(pCVar3 + 8),param_2,param_4);
  local_36c = &PTR_RecurseAndCallProxies_002adf78;
  local_250 = pCVar3;
  CDatatableStack::Init((CDatatableStack *)&local_36c,false);
  if (*(int *)(param_3 + 0x20) == 0) {
    local_384 = 0;
  }
  else {
    iVar6 = (((uint)(*(int *)(param_3 + 0x18) - *(int *)(param_3 + 0x20)) >> 2) * 0x20 -
            *(int *)(param_3 + 0x14)) + (*(uint *)(param_3 + 0xc) & 3) * 8;
    local_384 = *(int *)(param_3 + 8);
    if (iVar6 <= *(int *)(param_3 + 8)) {
      local_384 = iVar6;
    }
  }
  CDeltaBitsReader::CDeltaBitsReader(local_37c,param_3);
  iVar6 = local_384;
                    /* try { // try from 00151e4f to 00151fa3 has its CatchHandler @ 00152035 */
  while (local_384 = iVar6, iVar4 = CDeltaBitsReader::ReadNextPropIndex(local_37c), iVar4 != -1) {
    local_260 = iVar4;
    local_25c = *(undefined4 *)(*(int *)(local_368 + 0x2c) + iVar4 * 4);
    iVar6 = *(int *)(*(int *)(pCVar3 + 0x120) + iVar4 * 4);
    if (*(int *)(param_3 + 0x20) == 0) {
      local_388 = 0;
    }
    else {
      iVar1 = (((uint)(*(int *)(param_3 + 0x18) - *(int *)(param_3 + 0x20)) >> 2) * 0x20 -
              *(int *)(param_3 + 0x14)) + (*(uint *)(param_3 + 0xc) & 3) * 8;
      local_388 = *(int *)(param_3 + 8);
      if (iVar1 <= *(int *)(param_3 + 8)) {
        local_388 = iVar1;
      }
    }
    local_23c = 1;
    pbVar5 = (byte *)(*(int *)(local_368 + 0x40) + iVar4);
    local_230 = aiStack_364[*pbVar5];
    if (iVar6 == 0) {
      local_22c = 0;
    }
    else {
      local_22c = aiStack_364[*pbVar5] + *(int *)(iVar6 + 0x2c);
    }
    local_24c[0] = 0;
    if (aiStack_364[*pbVar5] != 0) {
      local_24c[0] = iVar6;
    }
    local_228 = *(int *)(*(int *)(pCVar3 + 0x34) + iVar4 * 4);
    local_234 = param_4;
    local_224 = param_3;
    (**(code **)(g_PropTypeFns + *(int *)(local_228 + 8) * 0x24 + 4))(local_24c);
    g_nPropsDecoded = g_nPropsDecoded + 1;
    if (*(int *)(param_3 + 0x20) == 0) {
      iVar6 = 0;
    }
    else {
      iVar6 = (((uint)(*(int *)(param_3 + 0x18) - *(int *)(param_3 + 0x20)) >> 2) * 0x20 -
              *(int *)(param_3 + 0x14)) + (*(uint *)(param_3 + 0xc) & 3) * 8;
      if (*(int *)(param_3 + 8) < iVar6) {
        iVar6 = *(int *)(param_3 + 8);
      }
    }
    if (g_bDTIEnabled != '\0') {
      _DTI_HookDeltaBits(pCVar3,iVar4,iVar6 - local_388,local_388 - local_384);
    }
  }
  bVar2 = param_3[4];
  CDeltaBitsReader::~CDeltaBitsReader(local_37c);
  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
                    /* WARNING: Subroutine does not return */
    __stack_chk_fail();
  }
  return (bool)((byte)bVar2 ^ 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)