Skip to content

Instantly share code, notes, and snippets.

@gablm
Created February 13, 2024 03:38
Show Gist options
  • Save gablm/2a79355026bde51ac4f516d347fa1cd0 to your computer and use it in GitHub Desktop.
Save gablm/2a79355026bde51ac4f516d347fa1cd0 to your computer and use it in GitHub Desktop.

Steam Shortcuts file and it's composition

Non-game Steam library entries are stored in a special file called shortcuts.vdf.

The file is located in the (steam folder)\userdata\(steamid)\config folder for each Steam user. It is encoded using ANSI formating.

Every file starts with the header \x00shortcuts\x00, followed by all shortcut entries.

After all entries, the file is terminated by \x08\x08. As all entry end with the same byte combination, the last 4 bytes of a file are always \x08\x08\x08\x08

Shortcut entry format

πŸ”€ represents where to insert the value in the Format column. Bools are represented using \x00(False) or \x01(True).

Name Description Data Type Format
EntryID Represents numerical order of each entry String \x00πŸ”€\x00
appid Represents the unique Steam ID for the shortcut. See next section on how to obtain this value. 4 Byte String \x02appid\x00πŸ”€
AppName Name for the shortcut String \x01AppName\x00πŸ”€\x00
Exe Full quoted path for the executable String \x01Exe\x00πŸ”€\x00
StartDir Target directory where the executable will start in. Does not need quotes. String \x01StartDir\x00πŸ”€\x00
icon Path to the App's icon. Does not need quotes. String \x01icon\x00πŸ”€\x00
ShortcutPath Represents the unique Steam ID for the shortcut. (can be empty) String \x01ShortcutPath\x00πŸ”€\x00
LaunchOptions Launch parameters for the executable. String \x01LaunchOptions\x00πŸ”€\x00
IsHidden If the shortcut is in the hidden library section. Bool \x02IsHidden\x00πŸ”€\x00\x00\x00
AllowDesktopConfig If Desktop Configuration is allowed via Steam UI. Bool \x02AllowDesktopConfig\x00πŸ”€\x00\x00\x00
AllowOverlay If the overlay can be drawn over the executable. Bool \x02AllowOverlay\x00πŸ”€\x00\x00\x00
OpenVR If the executable uses OpenVR. Bool \x02OpenVR\x00πŸ”€\x00\x00\x00
Devkit If it is a shortcut to a DevKit. Bool \x02Devkit\x00πŸ”€\x00\x00\x00
DevkitGameID ID for the game related to the DevKit (can be empty) String \x01DevkitGameID\x00πŸ”€\x00
DevkitOverrideAppID Represents the unique Steam ID for the shortcut. Bool \x02DevkitOverrideAppID\x00πŸ”€\x00\x00\x00
LastPlayTime Represents the timestamp of the last time the shortcut was executed. 4 byte String \x02LastPlayTime\x00πŸ”€
FlatpakAppID The Flatpak ID for the executable (applies to Linux systems, can be empty) String \x01FlatpakAppID\x00πŸ”€\x00
tags Has information about the categories the shortcut is in. String \x00tags\x00πŸ”€\x08\x08

Generating a Steam ID

  1. Append the Executable path (quoted) and the Shortcut Name (Exe + AppName)
  2. Get a hash using CRC32.
  3. Get the result from a OR operaton between this value and 0x80000000 (crc32hash | 0x80000000)
  4. Shift the result by 32 bits to the left (res3 << 32)
  5. Do another OR operation, but this time using 0x02000000 (res4 | 0x02000000)

Grid Files

A shortcut can contain various assets. These assets are not specified in the file above but are found in the grid folder next to the shortcuts.vdf file and have the shortcut's steamID in their name.

πŸ”€ == steamID

Name File Name Scheme Example
Hero πŸ”€_hero.png hero
Logo πŸ”€_logo.png logo
Banner πŸ”€p.png banner
Preview πŸ”€.png grid

Special Thanks

This documentation was based on some previous work found in the following links:

Implementation example

This is contribution to Collapse Launcher, an open-source launcher by neon-nyan for all miHoYo/Hoyoverse games.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment