L L4D2node

CBenchmarkResults::StopBenchmark

0x00113e30 · 380 bytes · __thiscall

_ZN17CBenchmarkResults13StopBenchmarkEv

Decompiled

undefined (1 param)

/* CBenchmarkResults::StopBenchmark() */

void __thiscall CBenchmarkResults::StopBenchmark(CBenchmarkResults *this)

{
  KeyValues *this_00;
  int iVar1;
  IBaseFileSystem *pIVar2;
  int in_GS_OFFSET;
  float fVar3;
  uint uVar4;
  char local_110 [256];
  int local_10;
  
  local_10 = *(int *)(in_GS_OFFSET + 0x14);
  *this = (CBenchmarkResults)0x0;
  ConVar::SetValue(0x3a11c0);
  fVar3 = (float)(host_framecount - *(int *)(this + 0x108)) /
          (realtime - (float)*(int *)(this + 0x104));
  Msg("Average framerate: %.2f\n",(double)fVar3);
  (**(code **)(*g_pFileSystem + 0x48))(g_pFileSystem,"results");
  uVar4 = 0x100;
  V_snprintf(local_110,0x100,"%s\\%s","results",this + 1);
  this_00 = KeyValues::operator_new((KeyValues *)0x2c,uVar4);
                    /* try { // try from 00113f1d to 00113f21 has its CatchHandler @ 00113fac */
  KeyValues::KeyValues(this_00,"benchmark",(IKeyValuesSystem *)0x0,false);
  KeyValues::SetFloat(this_00,"framerate",fVar3);
  iVar1 = build_number();
  KeyValues::SetInt(this_00,"build",iVar1);
  GetMaterialSystemConfigForBenchmarkUpload(this_00);
  pIVar2 = (IBaseFileSystem *)0x0;
  if (g_pFileSystem != (int *)0x0) {
    pIVar2 = (IBaseFileSystem *)(g_pFileSystem + 1);
  }
  KeyValues::SaveToFile(this_00,pIVar2,local_110,"MOD");
  KeyValues::deleteThis();
  if (local_10 == *(int *)(in_GS_OFFSET + 0x14)) {
    return;
  }
                    /* WARNING: Subroutine does not return */
  __stack_chk_fail(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)