L L4D2node

CSteamWorksGameStatsUploader::ParseKeyValuesAndSendStats

0x004c60f0 · 902 bytes · __thiscall

_ZN28CSteamWorksGameStatsUploader26ParseKeyValuesAndSendStatsEP9KeyValues.part.22

Decompiled

undefined (2 params)

/* CSteamWorksGameStatsUploader::ParseKeyValuesAndSendStats(KeyValues*) [clone .part.22] */

int __thiscall
CSteamWorksGameStatsUploader::ParseKeyValuesAndSendStats
          (CSteamWorksGameStatsUploader *this,KeyValues *param_1)

{
  char *in_EAX;
  undefined4 uVar1;
  KeyValues *this_00;
  char *pcVar2;
  undefined4 uVar3;
  int iVar4;
  int iVar5;
  KeyValues *in_EDX;
  char *pcVar6;
  int in_GS_OFFSET;
  byte bVar7;
  longdouble lVar8;
  undefined8 uVar9;
  char *pcVar10;
  char *pcVar11;
  char *pcVar12;
  char *pcVar13;
  char *local_12c;
  char *local_128;
  char local_124 [260];
  int local_20;
  
  bVar7 = 0;
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  uVar1 = KeyValues::GetName(in_EDX);
  if (*(int *)(steamworks_show_uploads._28_4_ + 0x30) != 0) {
    DevMsg("Server submitting table (%s).\n",uVar1);
  }
  local_12c = (char *)0x0;
  local_128 = (char *)0x0;
  (**(code **)(**(int **)(in_EAX + 0x48) + 0x14))
            (*(int **)(in_EAX + 0x48),&local_12c,*(undefined4 *)(in_EAX + 0x368),
             *(undefined4 *)(in_EAX + 0x36c),uVar1);
  iVar5 = 2;
  if (local_128 == (char *)0x0 && local_12c == (char *)0x0) {
LAB_004c6187:
    if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
      return iVar5;
    }
                    /* WARNING: Subroutine does not return */
    __stack_chk_fail();
  }
  pcVar13 = "SessionID";
  pcVar6 = local_12c;
  pcVar12 = local_128;
  WriteInt64ToTable(CONCAT44(*(undefined4 *)(in_EAX + 0x368),in_EAX),
                    CONCAT44(local_12c,*(undefined4 *)(in_EAX + 0x36c)),local_128);
  this_00 = (KeyValues *)KeyValues::GetFirstSubKey(in_EDX);
joined_r0x004c6206:
  if (this_00 != (KeyValues *)0x0) {
    do {
      pcVar2 = (char *)KeyValues::GetName(this_00);
      iVar5 = KeyValues::GetDataType(this_00,(char *)0x0);
      pcVar11 = local_128;
      pcVar10 = local_12c;
      if (iVar5 == 2) {
        uVar3 = KeyValues::GetInt(in_EDX,pcVar2,0);
        WriteIntToTable((int)in_EAX,CONCAT44(pcVar10,uVar3),pcVar11);
        pcVar6 = pcVar11;
        pcVar12 = pcVar2;
      }
      else if (iVar5 < 3) {
        if (iVar5 == 1) goto code_r0x004c62e2;
      }
      else if (iVar5 == 3) {
        lVar8 = (longdouble)KeyValues::GetFloat(in_EDX,pcVar2,0.0);
        WriteFloatToTable((float)in_EAX,CONCAT44(pcVar10,(float)lVar8),pcVar11);
        pcVar6 = pcVar11;
        pcVar12 = pcVar2;
      }
      else if (iVar5 == 7) {
        uVar9 = KeyValues::GetUint64((char *)in_EDX,ZEXT48(pcVar2));
        WriteInt64ToTable(CONCAT44((int)uVar9,in_EAX),
                          CONCAT44(pcVar10,(int)((ulonglong)uVar9 >> 0x20)),pcVar11);
        pcVar6 = pcVar10;
        pcVar12 = pcVar11;
        pcVar13 = pcVar2;
      }
      this_00 = (KeyValues *)KeyValues::GetNextKey(this_00);
      if (this_00 == (KeyValues *)0x0) break;
    } while( true );
  }
  iVar4 = (**(code **)(**(int **)(in_EAX + 0x48) + 0x18))
                    (*(int **)(in_EAX + 0x48),local_12c,local_128,pcVar6,pcVar12,pcVar13);
  iVar5 = 1;
  if (iVar4 != 1) {
    pcVar6 = local_124;
    for (iVar5 = 0x41; iVar5 != 0; iVar5 = iVar5 + -1) {
      pcVar6[0] = '\0';
      pcVar6[1] = '\0';
      pcVar6[2] = '\0';
      pcVar6[3] = '\0';
      pcVar6 = pcVar6 + ((uint)bVar7 * -2 + 1) * 4;
    }
    V_snprintf(local_124,0x104,"Failed To Submit table %s",uVar1);
    iVar5 = iVar4;
  }
  goto LAB_004c6187;
code_r0x004c62e2:
  uVar3 = KeyValues::GetString(in_EDX,pcVar2,"");
  WriteStringToTable(in_EAX,CONCAT44(pcVar10,uVar3),pcVar11);
  this_00 = (KeyValues *)KeyValues::GetNextKey(this_00);
  pcVar6 = pcVar11;
  pcVar12 = pcVar2;
  goto joined_r0x004c6206;
}

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)