-
Notifications
You must be signed in to change notification settings - Fork 4
/
get_palia_appid.sh
executable file
·53 lines (43 loc) · 1.99 KB
/
get_palia_appid.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/usr/bin/env bash
# Author: Give yourself some credit
# Purpose: What this script does
# Arguments: What arguments can be passed to the script
SHORTCUTS="/home/agotenshi/.local/share/Steam/userdata/64462332/config/shortcuts.vdf"
function cleanup {
rm -r $ramtmp
rm -r $ramshorts
}
trap cleanup EXIT
((skip=0)) # read bytes at this offset
((count=1024)) # read bytes at this offset
ramtmp="$(mktemp -p /dev/shm/)"
ramshorts="$(mktemp -p /dev/shm/)"
cp $SHORTCUTS $ramshorts
fsize=$(wc -c < "$ramshorts")
while [ $skip -le $fsize ] ; do
dd if=$ramshorts bs=1 skip=$skip count=$count of=$ramtmp 2>/dev/null
#cat $ramtmp | grep -aobPi 'appname\x00PaliaSTL' | head -n1 | grep -aoE '[0-9]+'
pos=$(cat $ramtmp | grep -aobPi 'appname\x00PaliaSTL' | head -n1 | grep -aoE '[0-9]+')
if [ $? -eq 0 ]; then
#echo $pos
((pos=pos+skip))
((apos=pos))
#echo $apos
#dd if=$ramshorts bs=1 skip=$apos count=20 of=$ramtmp 2>/dev/null
#cat $ramtmp
#cat $ramtmp | grep -aobPi 'appname\x00PaliaSTL' > /dev/null 2>&1
#if [ $? -eq 0 ]; then
((apos=pos-5))
dd if=$ramshorts bs=1 skip=$apos count=4 2>/dev/null | od -tu8 | head -n1 | grep -oE '[0-9]+' | tail -n1
exit 0
#fi
#((skip=pos+1))
else
((skip=skip+(count-20)))
fi
done
#XDG_CONFIG_HOME=$(pwd)/.config XDG_CACHE_HOME=$(pwd)/.cache XDG_DATA_HOME=$(pwd)/.local/share ./steamtinkerlaunch addnonsteamgame -ep="/home/agotenshi/temp/stl/steamtinkerlaunch-12.12/palia_steam_helper.sh" -an=PaliaSTL -ip="/home/agotenshi/temp/stl/steamtinkerlaunch-12.12/palia.png" -ao=1
#./steamtinkerlaunch sga 3739948084 --hero=/home/agotenshi/temp/stl/steamtinkerlaunch-12.12/images/palia-hero.png --logo=/home/agotenshi/temp/stl/steamtinkerlaunch-12.12/images/palia-logo.png --boxart=/home/agotenshi/temp/stl/steamtinkerlaunch-12.12/images/palia-boxart.png --tenfoot=/home/agotenshi/temp/stl/steamtinkerlaunch-12.12/images/palia-tenfoot.png
FSCV="$STUIDPATH/config/$SCVDF"
SCSRC="$STUIDPATH/config/$SCVDF"
STUIDPATH="$SUSDA/$STEAMUSERID"