L L4D2node

Host_RecomputeSpeed_f

0x00175300 · 194 bytes · unknown

_Z21Host_RecomputeSpeed_fv

Decompiled

undefined (0 params)

/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* WARNING: Unknown calling convention -- yet parameter storage is locked */
/* Host_RecomputeSpeed_f() */

void Host_RecomputeSpeed_f(void)

{
  int iVar1;
  
  ConMsg("Recomputing clock speed...\n");
  iVar1 = GetCPUInformation();
  _g_ClockSpeed = *(int *)(iVar1 + 8);
  _vswprintf = *(int *)(iVar1 + 0xc);
  _g_ClockSpeedSecondsMultiplier = (double)*(longlong *)(iVar1 + 8);
  if (_vswprintf < 0) {
    _g_ClockSpeedSecondsMultiplier = _g_ClockSpeedSecondsMultiplier + 1.8446744073709552e+19;
  }
  _g_ClockSpeedSecondsMultiplier = 1.0 / _g_ClockSpeedSecondsMultiplier;
  _g_ClockSpeedMicrosecondsMultiplier = _g_ClockSpeedSecondsMultiplier * 1000000.0;
  _g_ClockSpeedMillisecondsMultiplier = _g_ClockSpeedSecondsMultiplier * 1000.0;
  _g_dwClockSpeed = _g_ClockSpeed;
  ConMsg("Clock speed: %.0f Mhz\n",((double)(_g_ClockSpeed + -0x80000000) + 2147483648.0) * 1e-06);
  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)