L L4D2node

CGameEventManager::ParseEventList

0x00163050 · 1906 bytes · __thiscall

_ZN17CGameEventManager14ParseEventListEP17SVC_GameEventList

Decompiled

undefined (2 params)

/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* CGameEventManager::ParseEventList(SVC_GameEventList*) */

undefined4 __thiscall
CGameEventManager::ParseEventList(CGameEventManager *this,SVC_GameEventList *param_1)

{
  CBitRead *this_00;
  uint uVar1;
  undefined4 *puVar2;
  CGameEventManager *pCVar3;
  uint uVar4;
  int iVar5;
  uint *puVar6;
  KeyValues *this_01;
  uint *puVar7;
  int iVar8;
  uint uVar9;
  int in_GS_OFFSET;
  char *pcVar10;
  int local_60;
  uint local_5c;
  byte local_58;
  char local_40 [32];
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  pCVar3 = this + 0x9c;
  if (_SetSeed != 0) {
    if (CTelemetryLock::CTelemetryLock(void*,char_const*)::s_bNameSet == '\0') {
      (**(code **)(_SetSeed + 0x5c))
                (_SetSeed,pCVar3,&CTelemetryLock::CTelemetryLock(void*,char_const*)::tm_fmt,
                 "CGameEventManager");
      CTelemetryLock::CTelemetryLock(void*,char_const*)::s_bNameSet = '\x01';
      if (_SetSeed == 0) goto LAB_0016311c;
    }
    (**(code **)(_SetSeed + 0x60))
              (_SetSeed,0,0,0,"/data/src/public/tier0/vprof_telemetry.h",0x3eb,pCVar3,
               &CTelemetryLock::CTelemetryLock(void*,char_const*)::tm_fmt,&DAT_002c48a3,
               "CGameEventManager");
  }
LAB_0016311c:
                    /* try { // try from 0016311c to 00163120 has its CatchHandler @ 001637fa */
  uVar4 = ThreadGetCurrentId();
  if (uVar4 != *(uint *)(this + 0x9c)) {
    LOCK();
    uVar1 = *(uint *)pCVar3;
    if (uVar1 == 0) {
      *(uint *)pCVar3 = uVar4;
    }
    UNLOCK();
    if (uVar1 != 0) {
                    /* try { // try from 001637f0 to 001637f4 has its CatchHandler @ 001637fa */
      CThreadFastMutex::Lock((uint)pCVar3,uVar4);
      goto LAB_00163151;
    }
  }
  *(int *)(this + 0xa0) = *(int *)(this + 0xa0) + 1;
LAB_00163151:
                    /* try { // try from 00163198 to 001632b6 has its CatchHandler @ 0016380f */
  if ((_SetSeed != 0) &&
     ((**(code **)(_SetSeed + 100))
                (_SetSeed,0,0,"/data/src/public/tier0/vprof_telemetry.h",0x3f3,
                 &CTelemetryLock::Locked()::tm_fmt,pCVar3,0), _SetSeed != 0)) {
    (**(code **)(_SetSeed + 0x6c))
              (_SetSeed,pCVar3,2,"/data/src/public/tier0/vprof_telemetry.h",0x3f4,
               &CTelemetryLock::Locked()::tm_fmt,"%s Locked","CGameEventManager");
  }
  iVar8 = 0;
  iVar5 = 0;
  if (0 < *(int *)(this + 0x10)) {
    do {
      iVar5 = iVar5 + 1;
      *(undefined4 *)(*(int *)(this + 4) + iVar8) = 0xffffffff;
      iVar8 = iVar8 + 0x34;
    } while (iVar5 < *(int *)(this + 0x10));
  }
  if (0 < *(int *)(param_1 + 0x4c)) {
    this_00 = (CBitRead *)(param_1 + 0x54);
    local_60 = 0;
    do {
      iVar5 = *(int *)(param_1 + 0x68);
      if (iVar5 < 9) {
        puVar6 = *(uint **)(param_1 + 0x6c);
        local_5c = *(uint *)(param_1 + 100);
        if (puVar6 == *(uint **)(param_1 + 0x70)) {
          *(undefined4 *)(param_1 + 0x68) = 1;
          *(undefined4 *)(param_1 + 100) = 0;
          *(uint **)(param_1 + 0x6c) = puVar6 + 1;
          param_1[0x58] = (SVC_GameEventList)0x1;
        }
        else if (*(uint **)(param_1 + 0x70) < puVar6) {
          param_1[0x58] = (SVC_GameEventList)0x1;
          *(undefined4 *)(param_1 + 100) = 0;
        }
        else {
          *(uint **)(param_1 + 0x6c) = puVar6 + 1;
          uVar4 = *puVar6;
          *(uint *)(param_1 + 100) = uVar4;
          if (param_1[0x58] == (SVC_GameEventList)0x0) {
            uVar1 = (&CBitBuffer::s_nMaskTable)[9 - iVar5];
            *(int *)(param_1 + 0x68) = iVar5 + 0x17;
            *(uint *)(param_1 + 100) = uVar4 >> ((byte)(9 - iVar5) & 0x1f);
            local_5c = (uVar1 & uVar4) << ((byte)iVar5 & 0x1f) | local_5c;
            goto LAB_0016324e;
          }
        }
        local_5c = 0;
      }
      else {
        *(int *)(param_1 + 0x68) = iVar5 + -9;
        local_5c = *(uint *)(param_1 + 100) & 0x1ff;
        if (iVar5 + -9 == 0) {
          puVar2 = *(undefined4 **)(param_1 + 0x6c);
          *(undefined4 *)(param_1 + 0x68) = 0x20;
          if (puVar2 == *(undefined4 **)(param_1 + 0x70)) {
            *(undefined4 *)(param_1 + 0x68) = 1;
            *(undefined4 *)(param_1 + 100) = 0;
            *(undefined4 **)(param_1 + 0x6c) = puVar2 + 1;
          }
          else if (*(undefined4 **)(param_1 + 0x70) < puVar2) {
            param_1[0x58] = (SVC_GameEventList)0x1;
            *(undefined4 *)(param_1 + 100) = 0;
          }
          else {
            *(undefined4 **)(param_1 + 0x6c) = puVar2 + 1;
            *(undefined4 *)(param_1 + 100) = *puVar2;
          }
        }
        else {
          *(uint *)(param_1 + 100) = *(uint *)(param_1 + 100) >> 9;
        }
      }
LAB_0016324e:
      CBitRead::ReadString(this_00,local_40,0x20,false,(int *)0x0);
      pcVar10 = local_40;
      puVar6 = (uint *)GetEventDescriptor(this,pcVar10,(int *)0x0);
      if (puVar6 == (uint *)0x0) {
        do {
          iVar5 = *(int *)(param_1 + 0x68);
          if (iVar5 < 3) {
            puVar6 = *(uint **)(param_1 + 0x6c);
            uVar4 = *(uint *)(param_1 + 100);
            if (puVar6 == *(uint **)(param_1 + 0x70)) {
              *(undefined4 *)(param_1 + 0x68) = 1;
              *(undefined4 *)(param_1 + 100) = 0;
              *(uint **)(param_1 + 0x6c) = puVar6 + 1;
              param_1[0x58] = (SVC_GameEventList)0x1;
              goto LAB_00163408;
            }
            if (*(uint **)(param_1 + 0x70) < puVar6) {
              param_1[0x58] = (SVC_GameEventList)0x1;
              *(undefined4 *)(param_1 + 100) = 0;
              goto LAB_00163408;
            }
            *(uint **)(param_1 + 0x6c) = puVar6 + 1;
            uVar1 = *puVar6;
            *(uint *)(param_1 + 100) = uVar1;
            if (param_1[0x58] != (SVC_GameEventList)0x0) goto LAB_00163408;
            uVar9 = (&CBitBuffer::s_nMaskTable)[3 - iVar5];
            *(int *)(param_1 + 0x68) = iVar5 + 0x1d;
            uVar4 = (uVar9 & uVar1) << ((byte)iVar5 & 0x1f) | uVar4;
            *(uint *)(param_1 + 100) = uVar1 >> ((byte)(3 - iVar5) & 0x1f);
          }
          else {
            *(int *)(param_1 + 0x68) = iVar5 + -3;
            uVar4 = *(uint *)(param_1 + 100) & 7;
            if (iVar5 + -3 == 0) {
              puVar2 = *(undefined4 **)(param_1 + 0x6c);
              *(undefined4 *)(param_1 + 0x68) = 0x20;
              if (puVar2 == *(undefined4 **)(param_1 + 0x70)) {
                *(undefined4 *)(param_1 + 0x68) = 1;
                *(undefined4 *)(param_1 + 100) = 0;
                *(undefined4 **)(param_1 + 0x6c) = puVar2 + 1;
              }
              else if (*(undefined4 **)(param_1 + 0x70) < puVar2) {
                param_1[0x58] = (SVC_GameEventList)0x1;
                *(undefined4 *)(param_1 + 100) = 0;
              }
              else {
                *(undefined4 **)(param_1 + 0x6c) = puVar2 + 1;
                *(undefined4 *)(param_1 + 100) = *puVar2;
              }
            }
            else {
              *(uint *)(param_1 + 100) = *(uint *)(param_1 + 100) >> 3;
            }
          }
          if (uVar4 == 0) goto LAB_00163408;
          CBitRead::ReadString(this_00,local_40,0x20,false,(int *)0x0);
        } while( true );
      }
      if (puVar6[2] != 0) {
        KeyValues::deleteThis();
      }
      this_01 = KeyValues::operator_new((KeyValues *)0x2c,(uint)pcVar10);
                    /* try { // try from 001632d4 to 001632d8 has its CatchHandler @ 00163842 */
      KeyValues::KeyValues(this_01,"descriptor",(IKeyValuesSystem *)0x0,false);
      puVar6[2] = (uint)this_01;
      iVar5 = *(int *)(param_1 + 0x68);
      uVar4 = *(uint *)(param_1 + 100);
      if (iVar5 < 3) {
        puVar7 = *(uint **)(param_1 + 0x6c);
        if (puVar7 == *(uint **)(param_1 + 0x70)) {
LAB_00163560:
          *(undefined4 *)(param_1 + 0x68) = 1;
          *(undefined4 *)(param_1 + 100) = 0;
          *(uint **)(param_1 + 0x6c) = puVar7 + 1;
          param_1[0x58] = (SVC_GameEventList)0x1;
        }
        else if (puVar7 < *(uint **)(param_1 + 0x70)) {
          *(uint **)(param_1 + 0x6c) = puVar7 + 1;
          uVar1 = *puVar7;
          *(uint *)(param_1 + 100) = uVar1;
          if (param_1[0x58] == (SVC_GameEventList)0x0) {
            uVar9 = (&CBitBuffer::s_nMaskTable)[3 - iVar5];
            *(int *)(param_1 + 0x68) = iVar5 + 0x1d;
            uVar9 = (uVar9 & uVar1) << ((byte)iVar5 & 0x1f) | uVar4;
            *(uint *)(param_1 + 100) = uVar1 >> ((byte)(3 - iVar5) & 0x1f);
            goto joined_r0x00163309;
          }
        }
        else {
LAB_001634c4:
          param_1[0x58] = (SVC_GameEventList)0x1;
          *(undefined4 *)(param_1 + 100) = 0;
        }
      }
      else {
        *(int *)(param_1 + 0x68) = iVar5 + -3;
        uVar9 = uVar4 & 7;
        if (iVar5 + -3 == 0) {
          puVar2 = *(undefined4 **)(param_1 + 0x6c);
          *(undefined4 *)(param_1 + 0x68) = 0x20;
          if (puVar2 == *(undefined4 **)(param_1 + 0x70)) {
            *(undefined4 *)(param_1 + 0x68) = 1;
            *(undefined4 *)(param_1 + 100) = 0;
            *(undefined4 **)(param_1 + 0x6c) = puVar2 + 1;
          }
          else if (*(undefined4 **)(param_1 + 0x70) < puVar2) {
            param_1[0x58] = (SVC_GameEventList)0x1;
            *(undefined4 *)(param_1 + 100) = 0;
          }
          else {
            *(undefined4 **)(param_1 + 0x6c) = puVar2 + 1;
            *(undefined4 *)(param_1 + 100) = *puVar2;
          }
        }
        else {
          *(uint *)(param_1 + 100) = uVar4 >> 3;
        }
joined_r0x00163309:
        while (uVar9 != 0) {
                    /* try { // try from 00163335 to 001633d3 has its CatchHandler @ 0016380f */
          CBitRead::ReadString(this_00,local_40,0x20,false,(int *)0x0);
          KeyValues::SetInt((KeyValues *)puVar6[2],local_40,uVar9);
          iVar5 = *(int *)(param_1 + 0x68);
          if (iVar5 < 3) {
            uVar9 = *(uint *)(param_1 + 100);
            puVar7 = *(uint **)(param_1 + 0x6c);
            if (puVar7 == *(uint **)(param_1 + 0x70)) goto LAB_00163560;
            if (*(uint **)(param_1 + 0x70) < puVar7) goto LAB_001634c4;
            *(uint **)(param_1 + 0x6c) = puVar7 + 1;
            uVar4 = *puVar7;
            *(uint *)(param_1 + 100) = uVar4;
            if (param_1[0x58] != (SVC_GameEventList)0x0) break;
            uVar1 = (&CBitBuffer::s_nMaskTable)[3 - iVar5];
            *(int *)(param_1 + 0x68) = iVar5 + 0x1d;
            local_58 = (byte)(3 - iVar5);
            uVar9 = (uVar1 & uVar4) << ((byte)iVar5 & 0x1f) | uVar9;
            *(uint *)(param_1 + 100) = uVar4 >> (local_58 & 0x1f);
          }
          else {
            *(int *)(param_1 + 0x68) = iVar5 + -3;
            uVar9 = *(uint *)(param_1 + 100) & 7;
            if (iVar5 + -3 == 0) {
              puVar2 = *(undefined4 **)(param_1 + 0x6c);
              *(undefined4 *)(param_1 + 0x68) = 0x20;
              if (puVar2 == *(undefined4 **)(param_1 + 0x70)) {
                *(undefined4 *)(param_1 + 0x68) = 1;
                *(undefined4 *)(param_1 + 100) = 0;
                *(undefined4 **)(param_1 + 0x6c) = puVar2 + 1;
              }
              else if (*(undefined4 **)(param_1 + 0x70) < puVar2) {
                param_1[0x58] = (SVC_GameEventList)0x1;
                *(undefined4 *)(param_1 + 100) = 0;
              }
              else {
                *(undefined4 **)(param_1 + 0x6c) = puVar2 + 1;
                *(undefined4 *)(param_1 + 100) = *puVar2;
              }
            }
            else {
              *(uint *)(param_1 + 100) = *(uint *)(param_1 + 100) >> 3;
            }
          }
        }
      }
      *puVar6 = local_5c;
LAB_00163408:
      local_60 = local_60 + 1;
    } while (local_60 < *(int *)(param_1 + 0x4c));
  }
  this[0xa4] = (CGameEventManager)0x1;
  *(int *)(this + 0xa0) = *(int *)(this + 0xa0) + -1;
  if (*(int *)(this + 0xa0) == 0) {
    LOCK();
    *(uint *)pCVar3 = 0;
    UNLOCK();
  }
  if ((pCVar3 != (CGameEventManager *)0x0) && (_SetSeed != 0)) {
    (**(code **)(_SetSeed + 0x6c))
              (_SetSeed,pCVar3,1,"/data/src/public/tier0/vprof_telemetry.h",0x3fa,
               &CTelemetryLock::Unlocked()::tm_fmt,"%s Released","CGameEventManager");
  }
  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
                    /* WARNING: Subroutine does not return */
    __stack_chk_fail();
  }
  return 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)