/
test.sh
executable file
·64 lines (47 loc) · 1.24 KB
/
test.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
54
55
56
57
58
59
60
61
62
#!/bin/sh
usage()
{
cat << EOF
usage: $0 [options]
options: -s = swifter compile, otherwise default to v7s
-h = help
EOF
}
INTERNAL_PLATFORM=
gcc -std=gnu99 -m64 -o race race.c -I. -F/System/Library/PrivateFrameworks -framework MobileDevice -framework CoreFoundation -Wall
gcc -std=gnu99 -m64 -o interact interact.c -I. -F/System/Library/PrivateFrameworks -framework MobileDevice -framework CoreFoundation -Wall
while getopts "sh" OPTION
do
case $OPTION in
h)
usage
exit 1
;;
s)
INTERNAL_PLATFORM=swifter
;;
esac
done
echo Compiling for $INTERNAL_PLATFORM configuration
make PLATFORM=$INTERNAL_PLATFORM
cp obj/amfi_interpose.dylib ddi/
cp obj/jailbreak ddi/
cp bs.tar ddi/bootstrap.tar
sudo chmod 0644 ddi/Library/LaunchDaemons/*.plist
sudo chown root:wheel ddi/Library/LaunchDaemons/*.plist
sudo chmod +x ddi/usr/libexec/*
sudo chown root:wheel ddi/usr/libexec/*
sudo rm ddi.dmg
sudo hdiutil create -format UDZO -layout NONE -srcfolder ddi ddi.dmg
for ((x=299999; x!=1000000; x+=1))
do
OUTPUT=$(./race $x DeveloperDiskImage.dmg{,.signature} ddi.dmg)
echo $OUTPUT
if [[ $OUTPUT =~ Complete ]]; then
echo "Success!"
echo $x
break
fi
echo $x
done
#./race 300000 DeveloperDiskImage.dmg{,.signature} ddi.dmg