Skip to content

Commit

Permalink
Update daibutsu, fix tetherboot 10.x, other stuff
Browse files Browse the repository at this point in the history
- update daibutsu untether to 2.0.3, i didnt realize it got updated
- fix tetherboot for 10.x
- also fix edge case for 9A406 4S where ramdisks are decrypted, causing futurerestore to fail. workaround: create a custom ipsw and use idevicererestore instead
  • Loading branch information
LukeZGD committed Oct 1, 2023
1 parent 9a885c8 commit b13a96e
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 12 deletions.
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
- [idevicerestore](https://github.com/libimobiledevice/idevicerestore) - libimobiledevice; [LukeZGD fork](https://github.com/LukeZGD/idevicerestore)
- [idevicererestore](https://github.com/LukeZGD/daibutsuCFW/tree/main/src/idevicererestore) from daibutsuCFW (used on custom IPSW restores for A5/A6 devices)
- [kloader from Odysseus](https://www.youtube.com/watch?v=fh0tB6fp0Sc)
- [kloader from axi0mX](https://github.com/axi0mX/ios-kexec-utils/blob/master/kloader) (used on iOS 4 only)
- [kloader from axi0mX](https://github.com/axi0mX/ios-kexec-utils/blob/master/kloader) (used on iOS 4/5 only)
- [kloader for iOS 5](https://www.pmbonneau.com/cydia/com.pmbonneau.kloader5_1.2_iphoneos-arm.deb)
- [kloader_hgsp from nyan_satan](https://twitter.com/nyan_satan/status/945203180522045440) (used on h3lix only)
- [jq](https://github.com/jqlang/jq)
Expand All @@ -144,9 +144,8 @@
- [p0sixspwn](https://www.theiphonewiki.com/wiki/p0sixspwn)
- [unthredeh4il](https://www.theiphonewiki.com/wiki/Unthredera1n#unthredeh4il)
- [evasi0n](https://www.theiphonewiki.com/wiki/Evasi0n)
- [pris0nbarake](https://github.com/LukeZGD/pris0nbarake) - LukeZGD fork
- [g1lbertJB](https://github.com/g1lbertJB/g1lbertJB)
- [UntetherHomeDepot](https://www.theiphonewiki.com/wiki/UntetherHomeDepot)
- [greenpois0n](https://github.com/OpenJailbreak/greenpois0n/tree/0f1eac8e748abb200fc36969e616aaad009f7ebf)
- Some patches from [PwnageTool](https://www.theiphonewiki.com/wiki/PwnageTool), [sn0wbreeze](https://www.theiphonewiki.com/wiki/sn0wbreeze), [redsn0w](https://www.theiphonewiki.com/wiki/redsn0w)
- SSH Ramdisk tar from [SSH-Ramdisk-Maker-and-Loader](https://github.com/Ralph0045/SSH-Ramdisk-Maker-and-Loader) and [msftguy's ssh-rd](https://github.com/msftguy/ssh-rd)
- SSH Ramdisk tars from [SSH-Ramdisk-Maker-and-Loader](https://github.com/Ralph0045/SSH-Ramdisk-Maker-and-Loader) and [msftguy's ssh-rd](https://github.com/msftguy/ssh-rd)
Binary file modified resources/jailbreak/daibutsu/untether.tar
Binary file not shown.
40 changes: 31 additions & 9 deletions restore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2148,7 +2148,7 @@ ipsw_prepare_32bit() {
log "Found existing Custom IPSW. Skipping IPSW creation."
return
elif [[ $device_type != "$device_disable_bbupdate" && $ipsw_jailbreak != 1 &&
$device_proc != 4 && $device_actrec != 1 ]]; then
$device_proc != 4 && $device_actrec != 1 && $device_target_build != "9A406" ]]; then
log "No need to create custom IPSW for non-jailbroken restores on $device_type-$device_target_build"
return
elif [[ $ipsw_jailbreak == 1 && $device_target_vers == "8"* ]]; then
Expand Down Expand Up @@ -3125,12 +3125,31 @@ device_ramdisk() {
key=$(echo $device_fw_key | $jq -j '.keys[] | select(.image | startswith("'$getcomp'")) | .key')
case $getcomp in
"iBSS" | "iBEC" ) path="Firmware/dfu/";;
"DeviceTree" | "AppleLogo" ) path="Firmware/all_flash/all_flash.${device_model}ap.production/";;
"DeviceTree" )
path="Firmware/all_flash/"
case $build_id in
14[EFG]* ) :;;
* ) path+="all_flash.${device_model}ap.production/";;
esac
;;
* ) path="";;
esac
if [[ -z $name ]]; then
local hwmodel="$device_model"
case $build_id in
14[EFG]* )
case $device_type in
iPhone5,[12] ) hwmodel="iphone5";;
iPhone5,[34] ) hwmodel="iphone5b";;
iPad3,[456] ) hwmodel="ipad3b";;
esac
;;
7* | 8* | 9* | 10* | 11* ) hwmodel+="ap";;
esac
case $getcomp in
"iBSS" ) name="iBSS.${device_model}ap.RELEASE.dfu";;
"iBSS" | "iBEC" ) name="$getcomp.$hwmodel.RELEASE.dfu";;
"DeviceTree" ) name="$getcomp.${device_model}ap.img3";;
"Kernelcache" ) name="kernelcache.release.$hwmodel";;
esac
fi

Expand All @@ -3145,6 +3164,8 @@ device_ramdisk() {
if [[ $getcomp == "Kernelcache" || $getcomp == "iBSS" ]] && [[ $device_type == "iPod2,1" || $device_proc == 1 ]]; then
decrypt="-iv $iv -k $key"
"$dir/xpwntool" $getcomp.orig $getcomp.dec $decrypt
elif [[ $build_id == "14"* ]]; then
cp $getcomp.orig $getcomp.dec
else
"$dir/xpwntool" $getcomp.orig $getcomp.dec -iv $iv -k $key -decrypt
fi
Expand Down Expand Up @@ -3179,10 +3200,11 @@ device_ramdisk() {
fi
log "Patch iBSS"
"$dir/xpwntool" iBSS.dec iBSS.raw
"$dir/iBoot32Patcher" iBSS.raw iBSS.patched --rsa -b "-v"
"$dir/xpwntool" iBSS.patched iBSS -t iBSS.dec
if [[ $build_id == "7"* || $build_id == "8"* ]] && [[ $device_type != "iPad2"* ]]; then
"$dir/iBoot32Patcher" iBSS.raw iBSS.patched --rsa -b "-v"
:
else
"$dir/iBoot32Patcher" iBSS.raw iBSS.patched --rsa
log "Patch iBEC"
"$dir/xpwntool" iBEC.dec iBEC.raw
if [[ $1 == "justboot" ]]; then
Expand All @@ -3192,10 +3214,9 @@ device_ramdisk() {
fi
"$dir/xpwntool" iBEC.patched iBEC -t iBEC.dec
fi
"$dir/xpwntool" iBSS.patched iBSS -t iBSS.dec
fi

mv iBSS iBEC AppleLogo.dec DeviceTree.dec Kernelcache.dec Ramdisk.dmg $ramdisk_path 2>/dev/null
mv iBSS iBEC DeviceTree.dec Kernelcache.dec Ramdisk.dmg $ramdisk_path 2>/dev/null

if [[ $1 == "jailbreak" ]]; then
device_enter_mode pwnDFU
Expand Down Expand Up @@ -4415,7 +4436,7 @@ restore_dfuipsw() {
}

device_justboot() {
print "* You are about to do a tethered verbose boot."
print "* You are about to do a tethered boot."
print "* Enter the build version of the iOS version to use."
read -p "$(input 'Enter build version (eg. 9B206): ')" device_ramdisk_build
device_ramdisk justboot
Expand Down Expand Up @@ -4449,7 +4470,8 @@ main() {

version_check

if [[ ! -e "../resources/firstrun" || -z $zenity || $(cat "../resources/firstrun") != "$platform_ver" ]]; then
if [[ ! -e "../resources/firstrun" || $(cat "../resources/firstrun") != "$platform_ver" ||
-z $zenity || ! $(which curl) ]]; then
install_depends
fi

Expand Down

0 comments on commit b13a96e

Please sign in to comment.