Skip to content

Instantly share code, notes, and snippets.

@sonic2kk
Last active October 22, 2023 13:51
Show Gist options
  • Save sonic2kk/4a3383b401931a171a4addc29bdf903f to your computer and use it in GitHub Desktop.
Save sonic2kk/4a3383b401931a171a4addc29bdf903f to your computer and use it in GitHub Desktop.
Fetch all Steam Shortcut App IDs from shortcuts.vdf using Bash.
#!/usr/bin/env bash
# Magic that represents 'appid' column
magic_appid="617070696400"
# Paste in your Steam UserID
steam_userid=""
shortcuts_vdf="$HOME/.steam/root/userdata/${steam_userid}/config/shortcuts.vdf"
function convert_aid {
hex_aid="$1"
little_endian="$( echo "$hex_aid" | tac -rs .. | tr -d '\n' )"
echo "$((16#${little_endian}))"
}
# Get first 8 characters after magic and convert it from hex to 32bit unsigned integer
mapfile -t non_steam_appids < <(xxd -ps "$shortcuts_vdf" | grep -oP "${magic_appid}\K.{8}")
for nsi in "${non_steam_appids[@]}"; do
convert_aid "$nsi"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment