L L4D2node

ReportStats

0x008fddf0 · 772 bytes · __cdecl

_ZL11ReportStatsRK8CCommand

Decompiled

undefined (1 param)

/* ReportStats(CCommand const&) */

void ReportStats(CCommand *param_1)

{
  PlayerReport *this;
  int iVar1;
  char *pcVar2;
  uint uVar3;
  size_t sVar4;
  char *pcVar5;
  int iVar6;
  int iVar7;
  char *__s;
  char *pcVar8;
  
  pcVar2 = (char *)UTIL_GetCommandClient();
  iVar1 = ThePlayerReporter;
  if (pcVar2 != (char *)0x0) {
    if (*(int *)param_1 < 2) {
      pcVar8 = (char *)0x0;
      __s = (char *)0x0;
    }
    else {
      pcVar8 = *(char **)(param_1 + 0x40c);
      if (*(int *)param_1 == 2) {
        __s = (char *)0x0;
      }
      else {
        __s = *(char **)(param_1 + 0x410);
      }
    }
    uVar3 = (uint)*(ushort *)(ThePlayerReporter + 0x18);
    if (uVar3 != 0xffff) {
      iVar6 = *(int *)(ThePlayerReporter + 0xc);
      do {
        this = *(PlayerReport **)(iVar6 + uVar3 * 8);
        if (((pcVar8 == (char *)0x0) || (pcVar8 == "me")) ||
           (iVar6 = _V_stricmp(pcVar8,"me"), iVar6 == 0)) {
          iVar6 = *(int *)this;
          iVar7 = (**(code **)(*engine + 0x40))(engine,*(undefined4 *)(pcVar2 + 0x30));
          if (iVar6 == iVar7) goto LAB_008fdeb0;
        }
        else if (((pcVar8 == "all") || (iVar6 = _V_stricmp(pcVar8,"all"), iVar6 == 0)) ||
                ((((pcVar8 != "survivor" && (iVar6 = _V_stricmp(pcVar8,"survivor"), iVar6 != 0)) ||
                  (*(int *)(this + 0xc) == 2)) &&
                 ((pcVar5 = (char *)PlayerReport::GetName(this), pcVar8 == pcVar5 ||
                  (iVar6 = _V_stricmp(pcVar8,pcVar5), iVar6 == 0)))))) {
LAB_008fdeb0:
          if (__s == (char *)0x0) {
            PlayerReport::Print((CBasePlayer *)this,pcVar2);
          }
          else {
            sVar4 = strlen(__s);
            if (7 < sVar4) {
              sVar4 = 8;
            }
            iVar6 = V_strncmp(__s,"injuries",sVar4);
            if (iVar6 == 0) {
              pcVar5 = (char *)PlayerReport::GetName(this);
              PlayerReport::PrintInjuries(this,pcVar5);
            }
            else {
              sVar4 = strlen(__s);
              if (6 < sVar4) {
                sVar4 = 7;
              }
              iVar6 = V_strncmp(__s,"victims",sVar4);
              if (iVar6 == 0) {
LAB_008fe070:
                pcVar5 = (char *)PlayerReport::GetName(this);
                PlayerReport::PrintVictims(this,pcVar5);
              }
              else {
                sVar4 = strlen(__s);
                if (4 < sVar4) {
                  sVar4 = 5;
                }
                iVar6 = V_strncmp(__s,"death",sVar4);
                if (iVar6 == 0) {
                  pcVar5 = (char *)PlayerReport::GetName(this);
                  PlayerReport::PrintDeath(this,pcVar5);
                }
                else {
                  sVar4 = strlen(__s);
                  if (4 < sVar4) {
                    sVar4 = 5;
                  }
                  iVar6 = V_strncmp(__s,"medic",sVar4);
                  if (iVar6 == 0) {
                    pcVar5 = (char *)PlayerReport::GetName(this);
                    PlayerReport::PrintMedic(this,pcVar5);
                  }
                  else {
                    sVar4 = strlen(__s);
                    if (6 < sVar4) {
                      sVar4 = 7;
                    }
                    iVar6 = V_strncmp(__s,"victims",sVar4);
                    if (iVar6 == 0) goto LAB_008fe070;
                    sVar4 = strlen(__s);
                    if (4 < sVar4) {
                      sVar4 = 5;
                    }
                    iVar6 = V_strncmp(__s,"skill",sVar4);
                    if (iVar6 == 0) {
                      pcVar5 = (char *)PlayerReport::GetName(this);
                      PlayerReport::PrintSkill(this,pcVar5);
                    }
                  }
                }
              }
            }
          }
        }
        iVar6 = *(int *)(iVar1 + 0xc);
        uVar3 = (uint)*(ushort *)(iVar6 + 6 + uVar3 * 8);
      } while (uVar3 != 0xffff);
    }
  }
  return;
}

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)