L L4D2node

CHLTVClientState::ProcessGameEvent

0x00169fc0 · 550 bytes · __thiscall

_ZN16CHLTVClientState16ProcessGameEventEP13SVC_GameEvent

Decompiled

undefined (2 params)

/* CHLTVClientState::ProcessGameEvent(SVC_GameEvent*) */

undefined4 __thiscall
CHLTVClientState::ProcessGameEvent(CHLTVClientState *this,SVC_GameEvent *param_1)

{
  int *piVar1;
  int iVar2;
  undefined4 uVar3;
  char *pcVar4;
  uint uVar5;
  undefined1 *puVar6;
  int in_GS_OFFSET;
  undefined4 uStackY_70;
  int aiStack_60 [4];
  char *local_50 [3];
  undefined4 local_44;
  undefined4 local_40;
  undefined4 local_3c;
  undefined4 local_38;
  undefined4 local_34;
  undefined4 local_30;
  undefined4 local_2c;
  undefined4 local_28;
  undefined4 local_24;
  int local_20;
  
  puVar6 = &stack0xffffff94;
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  local_44 = *(undefined4 *)(param_1 + 0x50);
  local_40 = *(undefined4 *)(param_1 + 0x54);
  local_3c = *(undefined4 *)(param_1 + 0x58);
  local_38 = *(undefined4 *)(param_1 + 0x5c);
  local_34 = *(undefined4 *)(param_1 + 0x60);
  local_30 = *(undefined4 *)(param_1 + 100);
  local_2c = *(undefined4 *)(param_1 + 0x68);
  local_28 = *(undefined4 *)(param_1 + 0x6c);
  local_24 = *(undefined4 *)(param_1 + 0x70);
  uStackY_70 = 0x16a02a;
  piVar1 = (int *)(**(code **)(s_GameEventManager + 0x34))();
  if (piVar1 == (int *)0x0) {
LAB_0016a14b:
    iVar2 = *(int *)(param_1 + 0x4c) + 7 >> 3;
    uVar5 = iVar2 + 3;
    if ((int)uVar5 < 0) {
      uVar5 = iVar2 + 6;
    }
    local_50[0] = (char *)(uVar5 & 0xfffffffc);
    iVar2 = -(((uint)((char *)(uVar5 & 0xfffffffc) + 0xf) & 0xfffffff0) + 0x10);
    puVar6 = (undefined1 *)((int)local_50 + iVar2 + -0x1c);
    *(int *)(&stack0xffffff9c + iVar2) = *(int *)(param_1 + 0x4c);
    *(SVC_GameEvent **)((int)local_50 + iVar2 + -0x1c) = param_1 + 0x50;
    *(int *)((int)local_50 + iVar2 + -0x18) = (int)local_50 + iVar2;
    *(undefined4 *)((int)&uStackY_70 + iVar2) = 0x16a188;
    CBitRead::ReadBits(*(CBitRead **)((int)local_50 + iVar2 + -0x1c),
                       *(void **)((int)local_50 + iVar2 + -0x18),*(int *)(&stack0xffffff9c + iVar2))
    ;
    pcVar4 = local_50[0];
    *(undefined4 *)((int)aiStack_60 + iVar2 + 4) = 0xffffffff;
    uVar3 = *(undefined4 *)(param_1 + 0x4c);
    *(int *)((int)local_50 + iVar2 + -0x18) = (int)local_50 + iVar2;
    *(char **)(&stack0xffffff9c + iVar2) = pcVar4;
    *(SVC_GameEvent **)((int)local_50 + iVar2 + -0x1c) = param_1 + 0x74;
    *(undefined4 *)((int)aiStack_60 + iVar2) = uVar3;
    *(undefined4 *)((int)&uStackY_70 + iVar2) = 0x16a1ad;
    bf_write::StartWriting
              (*(bf_write **)((int)local_50 + iVar2 + -0x1c),
               *(void **)((int)local_50 + iVar2 + -0x18),*(int *)(&stack0xffffff9c + iVar2),
               *(int *)((int)aiStack_60 + iVar2),*(int *)((int)aiStack_60 + iVar2 + 4));
    *(undefined4 *)((int)aiStack_60 + iVar2) = 0;
    *(undefined4 *)(&stack0xffffff9c + iVar2) = 0;
    *(SVC_GameEvent **)((int)local_50 + iVar2 + -0x18) = param_1;
    *(undefined4 *)((int)local_50 + iVar2 + -0x1c) = *(undefined4 *)(this + 0x49ec);
    *(undefined4 *)((int)&uStackY_70 + iVar2) = 0x16a1cf;
    uVar3 = CHLTVServer::SendNetMsg
                      (*(INetMessage **)((int)local_50 + iVar2 + -0x1c),
                       *(bool *)((int)local_50 + iVar2 + -0x18),(bool)(&stack0xffffff9c)[iVar2]);
  }
  else {
    uStackY_70 = 0x16a03c;
    local_50[0] = (char *)(**(code **)(*piVar1 + 8))();
    uStackY_70 = 0x16a04f;
    iVar2 = _V_strcmp(local_50[0],"hltv_status");
    if (iVar2 == 0) {
      iVar2 = *(int *)(this + 0x49ec);
      uStackY_70 = 0x16a078;
      uVar3 = (**(code **)(*piVar1 + 0x1c))();
      *(undefined4 *)(iVar2 + 0x63b0) = uVar3;
      iVar2 = *(int *)(this + 0x49ec);
      uStackY_70 = 0x16a09c;
      uVar3 = (**(code **)(*piVar1 + 0x1c))();
      *(undefined4 *)(iVar2 + 0x63b8) = uVar3;
      iVar2 = *(int *)(this + 0x49ec);
      uStackY_70 = 0x16a0c0;
      uVar3 = (**(code **)(*piVar1 + 0x1c))();
      *(undefined4 *)(iVar2 + 0x63b4) = uVar3;
      uStackY_70 = 0x16a0de;
      pcVar4 = (char *)(**(code **)(*piVar1 + 0x28))();
      uStackY_70 = 0x16a0fd;
      netadr_s::SetFromString((netadr_s *)(*(int *)(this + 0x49ec) + 0x63a4),pcVar4,false);
    }
    else {
      uStackY_70 = 0x16a130;
      iVar2 = _V_strcmp(local_50[0],"hltv_title");
      if (iVar2 != 0) {
        uStackY_70 = 0x16a14b;
        (**(code **)(s_GameEventManager + 0x2c))();
        goto LAB_0016a14b;
      }
    }
    uStackY_70 = 0x16a114;
    (**(code **)(s_GameEventManager + 0x2c))();
    uVar3 = 1;
  }
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return uVar3;
  }
                    /* WARNING: Subroutine does not return */
  *(undefined **)(puVar6 + -4) = &UNK_0016a1e8;
  __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)