Patching game executables from Steam to allow overriding app ID
  • Rust 64.5%
  • Nix 35.5%
Find a file
2025-10-17 03:58:39 +03:00
src Initial commit 2025-10-17 03:58:39 +03:00
.envrc Initial commit 2025-10-17 03:58:39 +03:00
.gitignore Initial commit 2025-10-17 03:58:39 +03:00
Cargo.lock Initial commit 2025-10-17 03:58:39 +03:00
Cargo.toml Initial commit 2025-10-17 03:58:39 +03:00
flake.lock Initial commit 2025-10-17 03:58:39 +03:00
flake.nix Initial commit 2025-10-17 03:58:39 +03:00
LICENSE Initial commit 2025-10-17 03:58:39 +03:00
README.md Initial commit 2025-10-17 03:58:39 +03:00
rust-toolchain.toml Initial commit 2025-10-17 03:58:39 +03:00
shell.nix Initial commit 2025-10-17 03:58:39 +03:00

Appid-patcher

Appid-patcher searches game executable for variables storing Steam App ID and patching them to allow overriding the ID.

How Steamworks looks for App ID

Application that wants to use the Steamworks API is supposed to first call SteamAPI_Init to initialize the library.

Upon initialization, Steamworks needs to find the App ID of the application to verify that the active account owns it. To do so, it looks for environment variables SteamAppId and SteamGameId. When launching from Steam, the Steam client launches the application with these values set to the correct App ID.

That is, unless the executable is added as a non-Steam game, in which case SteamAppId is 0 and SteamGameId is set to some predictable hash. As an exception, when steam_appid.txt is present next to the executable, Steam uses the value stored there for both variables.

Some applications set the variables themselves, overriding whatever is in steam_appid.txt. This causes Steam to show two apps running at the same time. Appid-patcher is meant to fix this issue by searching through the application's executable and changing the variable names.

Effectively, this allows presenting any game that isn't protected by DRM to Steam as any other game you own. In particular, this can be used to play multiplayer with people who don't have a game in their library by sending them a copy of the game and agreeing on a single app ID which is owned by everyone in the group.

But what about DRM?

Not every application that is available on Steam is bundled with DRM. If you can launch it without starting Steam, it doesn't have DRM.

Applications that want the DRM protection are supposed to call SteamAPI_RestartAppIfNecessary before calling SteamAPI_Init to ensure that they are started from Steam with the correct environment. Many games do not do so.