L L4D2node

NET_SetConVar::ReadFromBuffer

0x000b7690 · 972 bytes · __thiscall

_ZN13NET_SetConVar14ReadFromBufferER7bf_read

Decompiled

undefined (2 params)

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

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

{
  int iVar1;
  uint *puVar2;
  undefined4 *puVar3;
  uint uVar4;
  uint uVar5;
  bf_read bVar6;
  char cVar7;
  int iVar8;
  uint uVar9;
  int in_GS_OFFSET;
  uint local_240;
  undefined4 local_23c;
  undefined4 local_238;
  undefined4 local_234;
  undefined4 local_230;
  int local_22c;
  NetMessageCvar_t local_228 [260];
  char local_124 [260];
  int local_20;
  
  local_23c = 0;
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  local_238 = 0;
  if (_exit == 0) {
    local_22c = 0;
  }
  else {
    (**(code **)(_exit + 0x50))
              (_exit,&local_23c,0,0,0,0,"/data/src/engine/../common/netmessages.cpp",0x473,
               &ReadFromBuffer(bf_read&)::tm_fmt,"(%s)%s","Unaccounted",
               "NET_SetConVar::ReadFromBuffer");
    local_22c = _exit;
  }
  iVar1 = _DAT_0040b9d4;
  local_234 = local_23c;
  local_230 = local_238;
  if ((_DAT_0040b028 != 0) || (DAT_0040b02c == '\0')) {
                    /* try { // try from 000b776b to 000b776f has its CatchHandler @ 000b7a60 */
    iVar8 = ThreadGetCurrentId();
    if (iVar1 == iVar8) {
      if ((char *)*_DAT_0040b030 != "NET_SetConVar::ReadFromBuffer") {
                    /* try { // try from 000b79bc to 000b79cd has its CatchHandler @ 000b7a60 */
        _DAT_0040b030 =
             (int *)CVProfNode::GetSubNode((char *)_DAT_0040b030,0x2a0727,&DAT_00000001,0x2a054b);
      }
      CVProfNode::EnterScope();
      DAT_0040b02c = '\0';
    }
  }
  iVar1 = *(int *)(param_1 + 0x14);
  uVar9 = *(uint *)(param_1 + 0x10);
  if (iVar1 < 8) {
    puVar2 = *(uint **)(param_1 + 0x18);
    if (puVar2 == *(uint **)(param_1 + 0x1c)) {
      *(undefined4 *)(param_1 + 0x14) = 1;
      *(undefined4 *)(param_1 + 0x10) = 0;
      *(uint **)(param_1 + 0x18) = puVar2 + 1;
      param_1[4] = (bf_read)0x1;
    }
    else if (*(uint **)(param_1 + 0x1c) < puVar2) {
      param_1[4] = (bf_read)0x1;
      *(undefined4 *)(param_1 + 0x10) = 0;
    }
    else {
      *(uint **)(param_1 + 0x18) = puVar2 + 1;
      uVar4 = *puVar2;
      *(uint *)(param_1 + 0x10) = uVar4;
      if (param_1[4] == (bf_read)0x0) {
        uVar5 = (&CBitBuffer::s_nMaskTable)[8 - iVar1];
        *(int *)(param_1 + 0x14) = iVar1 + 0x18;
        *(uint *)(param_1 + 0x10) = uVar4 >> ((byte)(8 - iVar1) & 0x1f);
        local_240 = (uVar5 & uVar4) << ((byte)iVar1 & 0x1f) | uVar9;
        goto LAB_000b77a9;
      }
    }
    bVar6 = (bf_read)0x1;
  }
  else {
    *(int *)(param_1 + 0x14) = iVar1 + -8;
    local_240 = uVar9 & 0xff;
    if (iVar1 + -8 == 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) = uVar9 >> 8;
    }
LAB_000b77a9:
    if (0 < (int)local_240) {
      *(undefined4 *)(this + 0x58) = 0;
      uVar9 = 0;
      do {
                    /* try { // try from 000b77f5 to 000b7842 has its CatchHandler @ 000b7a78 */
        CBitRead::ReadString((CBitRead *)param_1,(char *)local_228,0x104,false,(int *)0x0);
        CBitRead::ReadString((CBitRead *)param_1,local_124,0x104,false,(int *)0x0);
        CUtlVector<NetMessageCvar_t,CUtlMemory<NetMessageCvar_t,int>>::InsertBefore
                  ((CUtlVector<NetMessageCvar_t,CUtlMemory<NetMessageCvar_t,int>> *)(this + 0x4c),
                   *(int *)(this + 0x58),local_228);
        uVar9 = uVar9 + 1;
      } while (uVar9 != local_240);
    }
    bVar6 = param_1[4];
  }
  iVar1 = _DAT_0040b9d4;
  if ((DAT_0040b02c == '\0') || (_DAT_0040b028 != 0)) {
    iVar8 = ThreadGetCurrentId();
    if (iVar1 == iVar8) {
      cVar7 = CVProfNode::ExitScope();
      if (cVar7 != '\0') {
        _DAT_0040b030 = (int *)_DAT_0040b030[0x19];
      }
      DAT_0040b02c = _DAT_0040b030 == (int *)0x40b034;
    }
  }
  if (local_22c != 0) {
    (**(code **)(local_22c + 0x54))(local_22c,local_234,local_230,0,0,0);
  }
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return (byte)bVar6 ^ 1;
  }
                    /* WARNING: Subroutine does not return */
  __stack_chk_fail();
}

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)