L L4D2node

SVC_SetView::ReadFromBuffer

0x000ac640 · 682 bytes · __thiscall

_ZN11SVC_SetView14ReadFromBufferER7bf_read

Decompiled

undefined (2 params)

/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* SVC_SetView::ReadFromBuffer(bf_read&) */

byte __thiscall SVC_SetView::ReadFromBuffer(SVC_SetView *this,bf_read *param_1)

{
  bf_read bVar1;
  int iVar2;
  undefined4 *puVar3;
  uint *puVar4;
  uint uVar5;
  uint uVar6;
  char cVar7;
  int iVar8;
  uint uVar9;
  undefined4 local_34;
  undefined4 local_30;
  undefined4 local_28;
  undefined4 local_24;
  int local_20;
  
  local_34 = 0;
  local_30 = 0;
  if (_exit == 0) {
    local_20 = 0;
  }
  else {
    (**(code **)(_exit + 0x50))
              (_exit,&local_34,0,0,0,0,"/data/src/engine/../common/netmessages.cpp",0x365,
               &ReadFromBuffer(bf_read&)::tm_fmt,"(%s)%s","Unaccounted",
               "SVC_SetView::ReadFromBuffer");
    local_20 = _exit;
  }
  iVar2 = _DAT_0040b9d4;
  local_28 = local_34;
  local_24 = local_30;
  if ((_DAT_0040b028 != 0) || (DAT_0040b02c == '\0')) {
                    /* try { // try from 000ac6f2 to 000ac6f6 has its CatchHandler @ 000ac909 */
    iVar8 = ThreadGetCurrentId();
    if (iVar2 == iVar8) {
      if ((char *)*_DAT_0040b030 != "SVC_SetView::ReadFromBuffer") {
                    /* try { // try from 000ac870 to 000ac881 has its CatchHandler @ 000ac909 */
        _DAT_0040b030 =
             (int *)CVProfNode::GetSubNode((char *)_DAT_0040b030,0x2a055e,&DAT_00000001,0x2a054b);
      }
      CVProfNode::EnterScope();
      DAT_0040b02c = '\0';
    }
  }
  iVar2 = *(int *)(param_1 + 0x14);
  if (iVar2 < 0xb) {
    puVar4 = *(uint **)(param_1 + 0x18);
    uVar9 = *(uint *)(param_1 + 0x10);
    if (puVar4 == *(uint **)(param_1 + 0x1c)) {
      *(undefined4 *)(param_1 + 0x14) = 1;
      *(undefined4 *)(param_1 + 0x10) = 0;
      *(uint **)(param_1 + 0x18) = puVar4 + 1;
      param_1[4] = (bf_read)0x1;
    }
    else if (*(uint **)(param_1 + 0x1c) < puVar4) {
      param_1[4] = (bf_read)0x1;
      *(undefined4 *)(param_1 + 0x10) = 0;
    }
    else {
      *(uint **)(param_1 + 0x18) = puVar4 + 1;
      uVar5 = *puVar4;
      *(uint *)(param_1 + 0x10) = uVar5;
      if (param_1[4] == (bf_read)0x0) {
        uVar6 = (&CBitBuffer::s_nMaskTable)[0xb - iVar2];
        *(int *)(param_1 + 0x14) = iVar2 + 0x15;
        uVar9 = (uVar6 & uVar5) << ((byte)iVar2 & 0x1f) | uVar9;
        *(uint *)(param_1 + 0x10) = uVar5 >> ((byte)(0xb - iVar2) & 0x1f);
        goto LAB_000ac76a;
      }
    }
    uVar9 = 0;
  }
  else {
    *(int *)(param_1 + 0x14) = iVar2 + -0xb;
    uVar9 = *(uint *)(param_1 + 0x10) & 0x7ff;
    if (iVar2 + -0xb == 0) {
      puVar3 = *(undefined4 **)(param_1 + 0x18);
      *(undefined4 *)(param_1 + 0x14) = 0x20;
      if (puVar3 == *(undefined4 **)(param_1 + 0x1c)) {
        *(undefined4 *)(param_1 + 0x14) = 1;
        *(undefined4 *)(param_1 + 0x10) = 0;
        *(undefined4 **)(param_1 + 0x18) = puVar3 + 1;
      }
      else if (*(undefined4 **)(param_1 + 0x1c) < puVar3) {
        param_1[4] = (bf_read)0x1;
        *(undefined4 *)(param_1 + 0x10) = 0;
      }
      else {
        *(undefined4 **)(param_1 + 0x18) = puVar3 + 1;
        *(undefined4 *)(param_1 + 0x10) = *puVar3;
      }
    }
    else {
      *(uint *)(param_1 + 0x10) = *(uint *)(param_1 + 0x10) >> 0xb;
    }
  }
LAB_000ac76a:
  *(uint *)(this + 0x4c) = uVar9;
  iVar2 = _DAT_0040b9d4;
  bVar1 = param_1[4];
  if ((DAT_0040b02c == '\0') || (_DAT_0040b028 != 0)) {
    iVar8 = ThreadGetCurrentId();
    if (iVar2 == iVar8) {
      cVar7 = CVProfNode::ExitScope();
      if (cVar7 != '\0') {
        _DAT_0040b030 = (int *)_DAT_0040b030[0x19];
      }
      DAT_0040b02c = _DAT_0040b030 == (int *)0x40b034;
    }
  }
  if (local_20 != 0) {
    (**(code **)(local_20 + 0x54))(local_20,local_28,local_24,0,0,0);
  }
  return (byte)bVar1 ^ 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)