Skip to content

Instantly share code, notes, and snippets.

@frostworx
Last active August 15, 2021 12:20
Show Gist options
  • Save frostworx/373fda92e335b50c41d111bd15548b28 to your computer and use it in GitHub Desktop.
Save frostworx/373fda92e335b50c41d111bd15548b28 to your computer and use it in GitHub Desktop.
# any valid steam appid as arg1
#!/bin/bash
AIVDF="$HOME/.local/share/Steam/appcache/appinfo.vdf"
STLAPPINFOIDDIR="$HOME/.config/stl/games/appinfo"
function getRawAppIDInfo {
SEARCHID="$1"
HXTST="$(printf '%x\n' "$SEARCHID" | fold -w2 | tail -n1)"
if [ "${#HXTST}" -eq 1 ]; then
SHEX1="$(printf '0%x\n' "$SEARCHID" | fold -w2 | tac)";
else
SHEX1="$(printf '%x\n' "$SEARCHID" | fold -w2 | tac)";
fi
unset SHEXOUT
while read -r line; do
SHEXOUT="$SHEXOUT\x${line}"
done <<< "${SHEX1^^}"
echo "SHEXOUT '$SHEXOUT'"
#echo sed "\"s/\x61\x70\x70\x69\x64\x00${SHEXOUT}\x00\x00/APPID$1/g\"" "$AIVDF"
sed "s/\x61\x70\x70\x69\x64\x00${SHEXOUT}\x00\x00/APPID$1/g" "$AIVDF" | strings | sed -n "/APPID$1/,/^appid/p"
}
getRawAppIDInfo "$1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment