L L4D2node

CCSGameRules::UploadGameStats

0x004384b0 · 880 bytes · __thiscall

_ZN12CCSGameRules15UploadGameStatsEv

Decompiled

undefined (1 param)

/* CCSGameRules::UploadGameStats() */

void __thiscall CCSGameRules::UploadGameStats(CCSGameRules *this)

{
  undefined4 uVar1;
  char cVar2;
  char *pcVar3;
  undefined1 *puVar4;
  short sVar5;
  int iVar6;
  undefined4 *puVar7;
  undefined4 *puVar8;
  int in_GS_OFFSET;
  byte bVar9;
  char local_120 [8];
  undefined1 local_118;
  char local_117 [32];
  undefined1 local_f7;
  undefined1 local_f6;
  undefined1 local_f5;
  undefined1 local_f4;
  undefined2 local_f2;
  undefined4 local_f0;
  short local_ec;
  undefined4 local_ea;
  undefined4 local_e6;
  undefined4 local_e2;
  undefined4 local_de;
  undefined4 local_da;
  undefined4 local_d6;
  undefined4 local_d2;
  undefined4 local_ce;
  undefined4 local_ca;
  undefined4 local_c6;
  undefined4 local_c2;
  undefined4 local_be;
  undefined4 local_ba;
  undefined4 local_b6;
  undefined4 local_b2;
  undefined4 local_ae;
  undefined4 local_aa;
  undefined4 local_a6;
  undefined4 local_a2 [28];
  undefined2 local_32;
  undefined2 local_30;
  undefined2 local_2e;
  undefined2 local_2c;
  undefined2 local_2a;
  undefined2 local_28;
  undefined2 local_26;
  undefined2 local_24;
  int local_20;
  
  bVar9 = 0;
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  g_flGameStatsUpdateTime = g_flGameStatsUpdateTime - *(float *)(gpGlobals + 0xc);
  if (((g_flGameStatsUpdateTime <= 0.0) && (this[0x253] != (CCSGameRules)0x0)) &&
     (this[0x254] == (CCSGameRules)0x0)) {
    cVar2 = DataHasChanged();
    if (cVar2 != '\0') {
      pcVar3 = local_120;
      for (iVar6 = 0x40; iVar6 != 0; iVar6 = iVar6 + -1) {
        pcVar3[0] = '\0';
        pcVar3[1] = '\0';
        pcVar3[2] = '\0';
        pcVar3[3] = '\0';
        pcVar3 = pcVar3 + (uint)bVar9 * -8 + 4;
      }
      local_118 = 3;
      V_strncpy(local_120,"cstrike",8);
      pcVar3 = "";
      if (*(char **)(gpGlobals + 0x3c) != (char *)0x0) {
        pcVar3 = *(char **)(gpGlobals + 0x3c);
      }
      V_strncpy(local_117,pcVar3,0x20);
      iVar6 = (**(code **)(*cvar + 0x30))(cvar,"hostip");
      if (iVar6 != 0) {
        uVar1 = *(undefined4 *)(*(int *)(iVar6 + 0x1c) + 0x30);
        local_f4 = (undefined1)uVar1;
        local_f7 = (undefined1)((uint)uVar1 >> 0x18);
        local_f6 = (undefined1)((uint)uVar1 >> 0x10);
        local_f5 = (undefined1)((uint)uVar1 >> 8);
      }
      iVar6 = (**(code **)(*cvar + 0x30))(cvar,"hostip");
      if (iVar6 != 0) {
        local_f2 = (undefined2)*(undefined4 *)(*(int *)(iVar6 + 0x1c) + 0x30);
      }
      local_f0 = 0;
      sVar5 = (short)(int)(*(float *)(gpGlobals + 0xc) * 0.016666668);
      iVar6 = 0x1c;
      local_ec = 0;
      if (-1 < sVar5) {
        local_ec = sVar5;
      }
      local_ea = g_iTerroristVictories;
      local_e6 = DAT_00fc45c4;
      local_e2 = DAT_00fc45c8;
      local_de = DAT_00fc45cc;
      local_da = DAT_00fc45d0;
      local_d6 = DAT_00fc45d4;
      local_d2 = DAT_00fc45d8;
      local_ce = DAT_00fc45dc;
      local_ca = DAT_00fc45e0;
      local_c6 = g_iCounterTVictories;
      local_c2 = DAT_00fc4584;
      local_be = DAT_00fc4588;
      local_ba = DAT_00fc458c;
      local_b6 = DAT_00fc4590;
      local_b2 = DAT_00fc4594;
      local_ae = DAT_00fc4598;
      local_aa = DAT_00fc459c;
      local_a6 = DAT_00fc45a0;
      puVar7 = &g_iWeaponPurchases;
      puVar8 = local_a2;
      for (; iVar6 != 0; iVar6 = iVar6 + -1) {
        *puVar8 = *puVar7;
        puVar7 = puVar7 + (uint)bVar9 * -2 + 1;
        puVar8 = puVar8 + (uint)bVar9 * -2 + 1;
      }
      local_32 = g_iAutoBuyPurchases;
      local_30 = g_iReBuyPurchases;
      local_2e = g_iAutoBuyM4A1Purchases;
      local_2c = g_iAutoBuyAK47Purchases;
      local_2a = g_iAutoBuyFamasPurchases;
      local_28 = g_iAutoBuyGalilPurchases;
      local_26 = g_iAutoBuyVestHelmPurchases;
      local_24 = g_iAutoBuyVestPurchases;
      if (gamestatsuploader != (undefined4 *)0x0) {
        puVar4 = &DAT_00d539c2;
        if (*(undefined1 **)(gpGlobals + 0x3c) != (undefined1 *)0x0) {
          puVar4 = *(undefined1 **)(gpGlobals + 0x3c);
        }
        (**(code **)*gamestatsuploader)(gamestatsuploader,puVar4,3,0x100,local_120);
      }
      puVar7 = &g_iWeaponPurchases;
      for (iVar6 = 0x1c; iVar6 != 0; iVar6 = iVar6 + -1) {
        *puVar7 = 0;
        puVar7 = puVar7 + (uint)bVar9 * -2 + 1;
      }
      g_iAutoBuyAK47Purchases = 0;
      g_iAutoBuyFamasPurchases = 0;
      puVar7 = &g_iTerroristVictories;
      for (iVar6 = 9; iVar6 != 0; iVar6 = iVar6 + -1) {
        *puVar7 = 0;
        puVar7 = puVar7 + (uint)bVar9 * -2 + 1;
      }
      g_iReBuyPurchases = 0;
      puVar7 = &g_iCounterTVictories;
      for (iVar6 = 9; iVar6 != 0; iVar6 = iVar6 + -1) {
        *puVar7 = 0;
        puVar7 = puVar7 + (uint)bVar9 * -2 + 1;
      }
      g_iAutoBuyPurchases = 0;
      g_iAutoBuyVestHelmPurchases = 0;
      g_iAutoBuyM4A1Purchases = 0;
      g_iAutoBuyGalilPurchases = 0;
      g_iAutoBuyVestPurchases = 0;
    }
    g_flGameStatsUpdateTime = 79200.0;
  }
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return;
  }
                    /* 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)