L L4D2node

SetSteamAppUser

0x000d8f20 · 395 bytes · __cdecl

_Z15SetSteamAppUserP9KeyValuesPKcR13CSteamEnvVars

Decompiled

undefined (3 params)

/* SetSteamAppUser(KeyValues*, char const*, CSteamEnvVars&) */

void SetSteamAppUser(KeyValues *param_1,char *param_2,CSteamEnvVars *param_3)

{
  char *pcVar1;
  int iVar2;
  KeyValues *this;
  int in_GS_OFFSET;
  char local_228 [260];
  char local_124 [260];
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  pcVar1 = getenv(*(char **)(param_3 + 0x44));
  if (pcVar1 == (char *)0x0) {
    local_228[0] = '\0';
  }
  else {
    V_strncpy(local_228,pcVar1,0x104);
    iVar2 = _V_strlen(local_228);
    if (iVar2 != 0) goto LAB_000d8f7b;
  }
  if (param_1 == (KeyValues *)0x0) {
LAB_000d9008:
    V_strncpy(local_124,param_2,0x104);
    V_AppendSlash(local_124,0x104);
    V_strncat(local_124,"config\\SteamAppData.vdf",0x104,-1);
    this = (KeyValues *)ReadKeyValuesFile(local_124);
    if (this == (KeyValues *)0x0) {
LAB_000d90a8:
      Error("Can\'t find steam app user info.");
      pcVar1 = (char *)0x0;
    }
    else {
      pcVar1 = (char *)KeyValues::GetString(this,"AutoLoginUser",(char *)0x0);
      if (pcVar1 == (char *)0x0) goto LAB_000d90a8;
    }
    V_strncpy(local_228,pcVar1,0x104);
    KeyValues::deleteThis();
  }
  else {
    pcVar1 = (char *)KeyValues::GetString(param_1,"SteamAppUser",(char *)0x0);
    if (pcVar1 == (char *)0x0) goto LAB_000d9008;
    V_strncpy(local_228,pcVar1,0x104);
  }
  _V_strlower(local_228);
  CTempEnvVar::SetValue((CTempEnvVar *)(param_3 + 0x40),"%s",local_228);
LAB_000d8f7b:
  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)