Last active
August 15, 2021 12:20
-
-
Save frostworx/373fda92e335b50c41d111bd15548b28 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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