SHORTCUTVDFFILESTARTHEXPAT="0073686f7274637574730000300002"# Bytes for beginning of the shortcuts.vdf file
SHORTCUTVDFENTRYBEGINHEXPAT="00080800.*?0002"# Pattern for beginning of shortcut entry in shortcuts.vdf -- Beginning of file has a different pattern, but every other pattern begins like this
SHORTCUTSVDFENTRYENDHEXPAT="000808"# Pattern for how shortcuts.vdf blocks end
getSteamShortcutsVdfFileHex |grep-oP "(${SHORTCUTVDFFILESTARTHEXPAT}|${SHORTCUTVDFENTRYBEGINHEXPAT})\K.*?(?=${SHORTCUTSVDFENTRYENDHEXPAT})"# Get entire shortcuts.vdf as hex, then grep each entry using the begin and end patterns for each block
}
getSteamShortcutEntryHex(){
SHORTCUTSVDFINPUTHEX="$1"# The hex block representing the shortcut
SHORTCUTSVDFMATCHPATTERN="$2"# The pattern to match against in the block
SHORTCUTVDFENDPAT="0001"# Generic end pattern for each shortcut.vdf column
SHORTCUTVDFFILESTARTHEXPAT="0073686f7274637574730000300002"# Bytes for beginning of the shortcuts.vdf file
SHORTCUTVDFENTRYBEGINHEXPAT="00080800.*?0002"# Pattern for beginning of shortcut entry in shortcuts.vdf -- Beginning of file has a different pattern, but every other pattern begins like this
SHORTCUTSVDFENTRYENDHEXPAT="000808"# Pattern for how shortcuts.vdf blocks end
SHORTCUTVDFAPPIDHEXPAT="617070696400"# 'appid'
SHORTCUTVDFNAMEHEXPAT="(014170704e616d6500|6170706e616d6500)"# 'AppName' and 'appname'
SHORTCUTVDFENDPAT="0001"# Generic end pattern for each shortcut.vdf column
SHORTCUTVDFEXEHEXPAT="000145786500"# 'Exe' ('exe' is 6578650a if we ever need it)