L L4D2node

CMatchNetworkMsgControllerBase::UnpackGameDetailsFromQOS

0x00059c00 · 790 bytes · __thiscall

_ZN30CMatchNetworkMsgControllerBase24UnpackGameDetailsFromQOSEPK20MM_GameDetails_QOS_t

Decompiled

undefined (2 params)

/* CMatchNetworkMsgControllerBase::UnpackGameDetailsFromQOS(MM_GameDetails_QOS_t const*) */

KeyValues * __thiscall
CMatchNetworkMsgControllerBase::UnpackGameDetailsFromQOS
          (CMatchNetworkMsgControllerBase *this,MM_GameDetails_QOS_t *param_1)

{
  char cVar1;
  int iVar2;
  KeyValues *this_00;
  int *piVar3;
  int iVar4;
  int iVar5;
  char *pcVar6;
  int local_6c;
  int local_68;
  int local_64;
  undefined4 local_60;
  undefined4 local_5c;
  undefined4 local_58;
  int local_54 [3];
  int local_48;
  byte local_3f;
  int local_34;
  byte local_20;
  
  CUtlBuffer::CUtlBuffer((CUtlBuffer *)local_54,*(void **)param_1,*(int *)(param_1 + 4),8);
                    /* try { // try from 00059c37 to 00059cbd has its CatchHandler @ 00059f78 */
  CUtlBuffer::ActivateByteSwapping((CUtlBuffer *)local_54,true);
  if ((local_3f & 1) == 0) {
    cVar1 = CUtlBuffer::CheckGet((CUtlBuffer *)local_54,4);
    if (cVar1 == '\0') {
      iVar4 = 0;
    }
    else {
      if ((local_20 & 1) == 0) {
        iVar4 = *(int *)(local_54[0] + (local_48 - local_34));
      }
      else {
        piVar3 = (int *)((local_48 - local_34) + local_54[0]);
        if (piVar3 == (int *)0x0) {
          piVar3 = &local_6c;
        }
        local_60 = local_6c;
        local_60 = CONCAT31((int3)((uint)local_6c >> 8),*(undefined1 *)((int)piVar3 + 3));
        local_60._2_2_ = (undefined2)((uint)local_6c >> 0x10);
        local_60._0_2_ = CONCAT11(*(undefined1 *)((int)piVar3 + 2),*(undefined1 *)((int)piVar3 + 3))
        ;
        local_60._3_1_ = (undefined1)((uint)local_6c >> 0x18);
        local_60._0_3_ = CONCAT12(*(undefined1 *)((int)piVar3 + 1),(undefined2)local_60);
        local_60 = CONCAT13((char)*piVar3,(undefined3)local_60);
        _V_memcpy(&local_6c,&local_60,4);
        iVar4 = local_6c;
      }
      local_48 = local_48 + 4;
    }
  }
  else {
    local_6c = 0;
    CUtlBuffer::Scanf((CUtlBuffer *)local_54,"%d",&local_6c);
    iVar4 = local_6c;
  }
  if ((local_3f & 1) == 0) {
    pcVar6 = (char *)0x4;
    cVar1 = CUtlBuffer::CheckGet((CUtlBuffer *)local_54,4);
    if (cVar1 == '\0') {
      iVar5 = 0;
    }
    else {
      if ((local_20 & 1) == 0) {
        iVar5 = *(int *)(local_54[0] + (local_48 - local_34));
      }
      else {
        piVar3 = (int *)((local_48 - local_34) + local_54[0]);
        if (piVar3 == (int *)0x0) {
          piVar3 = &local_68;
        }
        local_5c = local_68;
        local_5c = CONCAT31((int3)((uint)local_68 >> 8),*(undefined1 *)((int)piVar3 + 3));
        local_5c._2_2_ = (undefined2)((uint)local_68 >> 0x10);
        local_5c._0_2_ = CONCAT11(*(undefined1 *)((int)piVar3 + 2),*(undefined1 *)((int)piVar3 + 3))
        ;
        local_5c._3_1_ = (undefined1)((uint)local_68 >> 0x18);
        local_5c._0_3_ = CONCAT12(*(undefined1 *)((int)piVar3 + 1),(undefined2)local_5c);
        local_5c = CONCAT13((char)*piVar3,(undefined3)local_5c);
        pcVar6 = (char *)&local_5c;
        _V_memcpy(&local_68,pcVar6,4);
        iVar5 = local_68;
      }
      local_48 = local_48 + 4;
    }
  }
  else {
    pcVar6 = "%d";
    local_68 = 0;
    CUtlBuffer::Scanf((CUtlBuffer *)local_54,"%d",&local_68);
    iVar5 = local_68;
  }
  iVar2 = (**(code **)(**(int **)(g_pMatchExtensions + 0x54) + 0x14))
                    (*(int **)(g_pMatchExtensions + 0x54));
  if ((iVar4 == iVar2) && (iVar5 == 0)) {
    this_00 = KeyValues::operator_new((KeyValues *)0x2c,(uint)pcVar6);
                    /* try { // try from 00059cdb to 00059cdf has its CatchHandler @ 00059f5e */
    KeyValues::KeyValues(this_00,"",(IKeyValuesSystem *)0x0,false);
                    /* try { // try from 00059ce7 to 00059f0d has its CatchHandler @ 00059f78 */
    cVar1 = KeyValues::ReadAsBinary(this_00,(CUtlBuffer *)local_54);
    if (cVar1 != '\0') {
      if ((local_3f & 1) == 0) {
        cVar1 = CUtlBuffer::CheckGet((CUtlBuffer *)local_54,4);
        if (cVar1 == '\0') goto LAB_00059d3a;
        if ((local_20 & 1) == 0) {
          iVar4 = *(int *)(local_54[0] + (local_48 - local_34));
        }
        else {
          piVar3 = (int *)((local_48 - local_34) + local_54[0]);
          if (piVar3 == (int *)0x0) {
            piVar3 = &local_64;
          }
          local_58 = local_64;
          local_58 = CONCAT31((int3)((uint)local_64 >> 8),*(undefined1 *)((int)piVar3 + 3));
          local_58._2_2_ = (undefined2)((uint)local_64 >> 0x10);
          local_58._0_2_ =
               CONCAT11(*(undefined1 *)((int)piVar3 + 2),*(undefined1 *)((int)piVar3 + 3));
          local_58._3_1_ = (undefined1)((uint)local_64 >> 0x18);
          local_58._0_3_ = CONCAT12(*(undefined1 *)((int)piVar3 + 1),(undefined2)local_58);
          local_58 = CONCAT13((char)*piVar3,(undefined3)local_58);
          _V_memcpy(&local_64,&local_58,4);
          iVar4 = local_64;
        }
        local_48 = local_48 + 4;
      }
      else {
        local_64 = 0;
        CUtlBuffer::Scanf((CUtlBuffer *)local_54,"%d",&local_64);
        iVar4 = local_64;
      }
      if (iVar4 != 0) {
        DevWarning("UnpackGameDetailsFromQOS found bad QOS block terminator!\n");
      }
      goto LAB_00059d3a;
    }
    KeyValues::deleteThis();
  }
  this_00 = (KeyValues *)0x0;
LAB_00059d3a:
  CUtlMemory<unsigned_char,int>::Purge((CUtlMemory<unsigned_char,int> *)local_54);
  return this_00;
}

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)