L L4D2node

Sys_Version

0x00216860 · 348 bytes · __cdecl

_Z11Sys_Versionb

Decompiled

undefined (1 param)

/* Sys_Version(bool) */

void Sys_Version(bool param_1)

{
  char cVar1;
  FILE *__s;
  int iVar2;
  int in_GS_OFFSET;
  uint local_114;
  char local_110 [256];
  int local_10;
  
  local_10 = *(int *)(in_GS_OFFSET + 0x14);
  CUtlString::operator=((CUtlString *)g_sVersionString,"1.0.1.0");
  CUtlString::operator=((CUtlString *)g_sNetworkVersionString,"1.0.1.0");
  CUtlString::operator=((CUtlString *)g_sProductString,"valve");
  local_114 = 0;
  ParseSteamInfFile("steam.inf",&local_114);
  cVar1 = (**(code **)(*g_pFileSystem + 0x14))(g_pFileSystem);
  if (cVar1 == '\0') {
    ParseSteamInfFile("perforce.inf",&local_114);
  }
  if ((local_114 != 0) &&
     (((cVar1 = (**(code **)(*g_pFileSystem + 0x14))(g_pFileSystem), cVar1 == '\0' || (param_1)) &&
      (__s = (FILE *)__wrap_fopen("steam_appid.txt",&DAT_002a5c80), __s != (FILE *)0x0)))) {
    V_snprintf(local_110,0x100,"%u\n",local_114);
    iVar2 = _V_strlen(local_110);
    fwrite(local_110,iVar2 + 1,1,__s);
    fclose(__s);
  }
  if (local_10 == *(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)