From 49d9609518ea7903e9fd0aa3eae0149b20fdd479 Mon Sep 17 00:00:00 2001 From: s0uthwest Date: Sat, 5 Jan 2019 06:32:25 -0800 Subject: [PATCH 01/69] Actualizing Xcode project --- .gitignore | 9 +- .gitmodules | 6 +- Makefile.am | 2 +- autogen.sh | 1 - futurerestore.xcodeproj/project.pbxproj | 245 +++++++++++++----- .../xcshareddata/IDEWorkspaceChecks.plist | 8 + .../xcschemes/xcschememanagement.plist | 14 + futurerestore/futurerestore.hpp | 3 - futurerestore/main.cpp | 2 +- 9 files changed, 212 insertions(+), 78 deletions(-) create mode 100644 futurerestore.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist create mode 100644 futurerestore.xcodeproj/xcuserdata/s0uthwest.xcuserdatad/xcschemes/xcschememanagement.plist diff --git a/.gitignore b/.gitignore index 9a51a1dcd..4f9a2caae 100644 --- a/.gitignore +++ b/.gitignore @@ -19,16 +19,15 @@ libtool ltmain.sh m4 missing +futurerestore/.DS_Store futurerestore/*.o futurerestore/*.la futurerestore/*.lo +futurerestore/config.h.bak futurerestore/futurerestore futurerestore/futurerestore.exe futurerestore/.libs futurerestore/.deps stamp-h1 - -# Clion -.idea/ -cmake-*/ -CMakeLists.txt +.DS_Store +external/.DS_Store \ No newline at end of file diff --git a/.gitmodules b/.gitmodules index cc305fc38..fe901c9ee 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,9 +1,9 @@ [submodule "external/img4tool"] path = external/img4tool - url = https://github.com/encounter/img4tool.git + url = https://github.com/tihmstar/img4tool.git [submodule "external/tsschecker"] path = external/tsschecker - url = https://github.com/encounter/tsschecker.git + url = https://github.com/s0uthwest/tsschecker.git [submodule "external/idevicerestore"] path = external/idevicerestore - url = https://github.com/encounter/idevicerestore.git + url = https://github.com/s0uthwest/idevicerestore.git diff --git a/Makefile.am b/Makefile.am index 9cf3a6a70..442721478 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,4 +1,4 @@ AUTOMAKE_OPTIONS = foreign ACLOCAL_AMFLAGS = -I m4 SUBDIRS = external/idevicerestore external/img4tool external/tsschecker futurerestore -install installdirs: SUBDIRS = futurerestore +install installdirs: SUBDIRS = futurerestore \ No newline at end of file diff --git a/autogen.sh b/autogen.sh index 24134441f..8c450d825 100755 --- a/autogen.sh +++ b/autogen.sh @@ -25,4 +25,3 @@ if [ -z "$NOCONFIGURE" ]; then ./configure "$@" fi ./setBuildVersion.sh - diff --git a/futurerestore.xcodeproj/project.pbxproj b/futurerestore.xcodeproj/project.pbxproj index c79de8748..21417fc36 100644 --- a/futurerestore.xcodeproj/project.pbxproj +++ b/futurerestore.xcodeproj/project.pbxproj @@ -7,15 +7,26 @@ objects = { /* Begin PBXBuildFile section */ + 5604B7B9219B35EE004C22EE /* libpartialzip-1.0.0.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 5604B7B8219B35EE004C22EE /* libpartialzip-1.0.0.dylib */; }; + 5604B7BB219B35F8004C22EE /* libirecovery.2.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 5604B7BA219B35F8004C22EE /* libirecovery.2.dylib */; }; + 5604B7BD219B3602004C22EE /* liblzfse.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 5604B7BC219B3602004C22EE /* liblzfse.dylib */; }; + 5604B7BF219B3611004C22EE /* libzip.5.0.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 5604B7BE219B3610004C22EE /* libzip.5.0.dylib */; }; + 5604B7C1219B3619004C22EE /* libz.1.2.11.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 5604B7C0219B3619004C22EE /* libz.1.2.11.dylib */; }; + 5604B7C3219B3626004C22EE /* libplist.3.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 5604B7C2219B3626004C22EE /* libplist.3.dylib */; }; + 5604B7C5219B362E004C22EE /* libimobiledevice.6.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 5604B7C4219B362E004C22EE /* libimobiledevice.6.dylib */; }; + 5604B7C7219B3630004C22EE /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 5604B7C6219B3630004C22EE /* libz.tbd */; }; + 5604B7C9219B3632004C22EE /* libcurl.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 5604B7C8219B3632004C22EE /* libcurl.tbd */; }; + 563DA64521BBE44900844624 /* libcrypto.3.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 563DA64421BBE44900844624 /* libcrypto.3.dylib */; }; + 56520BEB21B1BA91005BD3F7 /* lzssdec.c in Sources */ = {isa = PBXBuildFile; fileRef = 56520BE921B1BA90005BD3F7 /* lzssdec.c */; }; + 56520BEF21B1BADE005BD3F7 /* endianness.h in Sources */ = {isa = PBXBuildFile; fileRef = 878587571D89D1C1008689F0 /* endianness.h */; }; + 56520BF021B1BAE6005BD3F7 /* limera1n_payload.h in Sources */ = {isa = PBXBuildFile; fileRef = 878587661D89D1C1008689F0 /* limera1n_payload.h */; }; + 56520BFA21B1BB14005BD3F7 /* jssy.c in Sources */ = {isa = PBXBuildFile; fileRef = 56520BF221B1BB13005BD3F7 /* jssy.c */; }; + 56520BFB21B1BB14005BD3F7 /* cmain.c in Sources */ = {isa = PBXBuildFile; fileRef = 56520BF321B1BB13005BD3F7 /* cmain.c */; }; + 56520BFC21B1BB14005BD3F7 /* jssy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 56520BF621B1BB13005BD3F7 /* jssy.cpp */; }; + 56EF4C0921B1A8570056D405 /* libipatcher.0.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 56EF4C0821B1A8570056D405 /* libipatcher.0.dylib */; }; + 56EF4C0D21B1A8750056D405 /* libusbmuxd.4.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 56EF4C0C21B1A8750056D405 /* libusbmuxd.4.dylib */; }; + 56EF4C0F21B1A8850056D405 /* libfragmentzip.0.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 56EF4C0E21B1A8850056D405 /* libfragmentzip.0.dylib */; }; 878587471D89CFDC008689F0 /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 878587461D89CFDC008689F0 /* main.cpp */; }; - 878587A71D89D56E008689F0 /* libplist.3.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 878587A61D89D56E008689F0 /* libplist.3.dylib */; }; - 878587AB1D89D590008689F0 /* libimobiledevice.6.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 878587AA1D89D590008689F0 /* libimobiledevice.6.dylib */; }; - 878587AD1D89D59E008689F0 /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 878587AC1D89D59E008689F0 /* libz.tbd */; }; - 878587AF1D89D5A5008689F0 /* libcurl.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 878587AE1D89D5A5008689F0 /* libcurl.tbd */; }; - 878587B71D89D637008689F0 /* libirecovery.2.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 878587B61D89D637008689F0 /* libirecovery.2.dylib */; }; - 8788A6811EE8426A00138E07 /* libipatcher.0.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 8788A6801EE8426A00138E07 /* libipatcher.0.dylib */; }; - 8788A6831EE8544000138E07 /* jssy.c in Sources */ = {isa = PBXBuildFile; fileRef = 8788A6821EE8544000138E07 /* jssy.c */; }; - 878E1AC51F73EB3F00B1565B /* libzip.5.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 878E1AC41F73EB3F00B1565B /* libzip.5.dylib */; }; 8799B0B21D89D99D002F4D5F /* futurerestore.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8799B0B01D89D99D002F4D5F /* futurerestore.cpp */; }; 8799B0B31D89DAE7002F4D5F /* idevicerestore.c in Sources */ = {isa = PBXBuildFile; fileRef = 8785875C1D89D1C1008689F0 /* idevicerestore.c */; settings = {COMPILER_FLAGS = "-D HAVE_CONFIG_H=1 "; }; }; 8799B0B41D89DAF6002F4D5F /* tss.c in Sources */ = {isa = PBXBuildFile; fileRef = 878587761D89D1C1008689F0 /* tss.c */; }; @@ -40,8 +51,6 @@ 8799B0CA1D89E371002F4D5F /* img4.c in Sources */ = {isa = PBXBuildFile; fileRef = 878587601D89D1C1008689F0 /* img4.c */; }; 8799B0CB1D89F796002F4D5F /* tsschecker.c in Sources */ = {isa = PBXBuildFile; fileRef = 8785879F1D89D2BA008689F0 /* tsschecker.c */; }; 8799B0CC1D89F7B9002F4D5F /* download.c in Sources */ = {isa = PBXBuildFile; fileRef = 878587981D89D2BA008689F0 /* download.c */; }; - 87F574CB1E151E97008D5C4D /* libfragmentzip.0.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 87F574CA1E151E97008D5C4D /* libfragmentzip.0.dylib */; }; - 87F574D01E151F44008D5C4D /* libcrypto.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 87F574C51E151D42008D5C4D /* libcrypto.dylib */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -57,6 +66,30 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 5604B7B8219B35EE004C22EE /* libpartialzip-1.0.0.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libpartialzip-1.0.0.dylib"; path = "../../../../../usr/local/lib/libpartialzip-1.0.0.dylib"; sourceTree = ""; }; + 5604B7BA219B35F8004C22EE /* libirecovery.2.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libirecovery.2.dylib; path = ../../../../../usr/local/lib/libirecovery.2.dylib; sourceTree = ""; }; + 5604B7BC219B3602004C22EE /* liblzfse.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = liblzfse.dylib; path = ../../../../../usr/local/lib/liblzfse.dylib; sourceTree = ""; }; + 5604B7BE219B3610004C22EE /* libzip.5.0.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libzip.5.0.dylib; path = ../../../../../usr/local/lib/libzip.5.0.dylib; sourceTree = ""; }; + 5604B7C0219B3619004C22EE /* libz.1.2.11.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.1.2.11.dylib; path = ../../../../../usr/local/lib/libz.1.2.11.dylib; sourceTree = ""; }; + 5604B7C2219B3626004C22EE /* libplist.3.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libplist.3.dylib; path = ../../../../../usr/local/lib/libplist.3.dylib; sourceTree = ""; }; + 5604B7C4219B362E004C22EE /* libimobiledevice.6.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libimobiledevice.6.dylib; path = ../../../../../usr/local/lib/libimobiledevice.6.dylib; sourceTree = ""; }; + 5604B7C6219B3630004C22EE /* libz.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = usr/lib/libz.tbd; sourceTree = SDKROOT; }; + 5604B7C8219B3632004C22EE /* libcurl.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libcurl.tbd; path = usr/lib/libcurl.tbd; sourceTree = SDKROOT; }; + 563DA64221BBE40700844624 /* all.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = all.h; sourceTree = ""; }; + 563DA64321BBE41C00844624 /* all.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = all.h; path = external/tsschecker/tsschecker/all.h; sourceTree = SOURCE_ROOT; }; + 563DA64421BBE44900844624 /* libcrypto.3.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libcrypto.3.dylib; path = ../../../../../usr/local/lib/libcrypto.3.dylib; sourceTree = ""; }; + 56520BE921B1BA90005BD3F7 /* lzssdec.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = lzssdec.c; sourceTree = ""; }; + 56520BEA21B1BA90005BD3F7 /* lzssdec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lzssdec.h; sourceTree = ""; }; + 56520BF221B1BB13005BD3F7 /* jssy.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = jssy.c; path = external/tsschecker/external/jssy/jssy/jssy.c; sourceTree = SOURCE_ROOT; }; + 56520BF321B1BB13005BD3F7 /* cmain.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = cmain.c; path = external/tsschecker/external/jssy/jssy/cmain.c; sourceTree = SOURCE_ROOT; }; + 56520BF421B1BB13005BD3F7 /* jssy.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = jssy.hpp; path = external/tsschecker/external/jssy/jssy/jssy.hpp; sourceTree = SOURCE_ROOT; }; + 56520BF521B1BB13005BD3F7 /* helper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = helper.h; path = external/tsschecker/external/jssy/jssy/helper.h; sourceTree = SOURCE_ROOT; }; + 56520BF621B1BB13005BD3F7 /* jssy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = jssy.cpp; path = external/tsschecker/external/jssy/jssy/jssy.cpp; sourceTree = SOURCE_ROOT; }; + 56520BF721B1BB13005BD3F7 /* ptr_smart.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ptr_smart.hpp; path = external/tsschecker/external/jssy/jssy/ptr_smart.hpp; sourceTree = SOURCE_ROOT; }; + 56520BF821B1BB13005BD3F7 /* jssy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = jssy.h; path = external/tsschecker/external/jssy/jssy/jssy.h; sourceTree = SOURCE_ROOT; }; + 56EF4C0821B1A8570056D405 /* libipatcher.0.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libipatcher.0.dylib; path = ../../../../../usr/local/lib/libipatcher.0.dylib; sourceTree = ""; }; + 56EF4C0C21B1A8750056D405 /* libusbmuxd.4.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libusbmuxd.4.dylib; path = ../../../../../usr/local/lib/libusbmuxd.4.dylib; sourceTree = ""; }; + 56EF4C0E21B1A8850056D405 /* libfragmentzip.0.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libfragmentzip.0.dylib; path = ../../../../../usr/local/lib/libfragmentzip.0.dylib; sourceTree = ""; }; 878587431D89CFDC008689F0 /* futurerestore */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = futurerestore; sourceTree = BUILT_PRODUCTS_DIR; }; 878587461D89CFDC008689F0 /* main.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = ""; }; 8785874F1D89D1C1008689F0 /* asr.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = asr.c; sourceTree = ""; }; @@ -99,35 +132,18 @@ 878587751D89D1C1008689F0 /* thread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = thread.h; sourceTree = ""; }; 878587761D89D1C1008689F0 /* tss.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tss.c; sourceTree = ""; }; 878587771D89D1C1008689F0 /* tss.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tss.h; sourceTree = ""; }; - 8785878C1D89D1ED008689F0 /* all_img4tool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = all_img4tool.h; sourceTree = ""; }; 8785878E1D89D1ED008689F0 /* img4.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = img4.c; sourceTree = ""; }; 8785878F1D89D1ED008689F0 /* img4.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = img4.h; sourceTree = ""; }; 878587901D89D1ED008689F0 /* img4tool.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = img4tool.c; sourceTree = ""; }; 878587941D89D243008689F0 /* img4tool.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = img4tool.h; sourceTree = ""; }; 878587951D89D290008689F0 /* config.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = config.h; sourceTree = ""; }; - 878587971D89D2BA008689F0 /* all_tsschecker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = all_tsschecker.h; sourceTree = ""; }; 878587981D89D2BA008689F0 /* download.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = download.c; sourceTree = ""; }; 878587991D89D2BA008689F0 /* download.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = download.h; sourceTree = ""; }; - 8785879A1D89D2BA008689F0 /* jsmn.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = jsmn.c; sourceTree = ""; }; - 8785879B1D89D2BA008689F0 /* jsmn.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsmn.h; sourceTree = ""; }; 8785879F1D89D2BA008689F0 /* tsschecker.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tsschecker.c; sourceTree = ""; }; 878587A01D89D2BA008689F0 /* tsschecker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tsschecker.h; sourceTree = ""; }; - 878587A61D89D56E008689F0 /* libplist.3.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libplist.3.dylib; path = ../../../../usr/local/lib/libplist.3.dylib; sourceTree = ""; }; - 878587A81D89D578008689F0 /* libirecovery.1.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libirecovery.1.dylib; path = ../../../../usr/local/lib/libirecovery.1.dylib; sourceTree = ""; }; - 878587AA1D89D590008689F0 /* libimobiledevice.6.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libimobiledevice.6.dylib; path = ../../../../usr/local/lib/libimobiledevice.6.dylib; sourceTree = ""; }; - 878587AC1D89D59E008689F0 /* libz.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = usr/lib/libz.tbd; sourceTree = SDKROOT; }; - 878587AE1D89D5A5008689F0 /* libcurl.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libcurl.tbd; path = usr/lib/libcurl.tbd; sourceTree = SDKROOT; }; - 878587B21D89D5D5008689F0 /* libzip.4.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libzip.4.dylib; path = ../../../../usr/local/lib/libzip.4.dylib; sourceTree = ""; }; - 878587B41D89D5E6008689F0 /* libpartialzip-1.0.0.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libpartialzip-1.0.0.dylib"; path = "../../../../usr/local/lib/libpartialzip-1.0.0.dylib"; sourceTree = ""; }; - 878587B61D89D637008689F0 /* libirecovery.2.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libirecovery.2.dylib; path = ../../../../usr/local/lib/libirecovery.2.dylib; sourceTree = ""; }; - 8788A6801EE8426A00138E07 /* libipatcher.0.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libipatcher.0.dylib; path = ../../../../usr/local/lib/libipatcher.0.dylib; sourceTree = ""; }; - 8788A6821EE8544000138E07 /* jssy.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = jssy.c; path = external/tsschecker/external/jssy/jssy/jssy.c; sourceTree = ""; }; - 878E1AC41F73EB3F00B1565B /* libzip.5.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libzip.5.dylib; path = ../../../../usr/local/Cellar/libzip/1.3.0/lib/libzip.5.dylib; sourceTree = ""; }; 8799B0B01D89D99D002F4D5F /* futurerestore.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = futurerestore.cpp; sourceTree = ""; }; 8799B0B11D89D99D002F4D5F /* futurerestore.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = futurerestore.hpp; sourceTree = ""; }; - 87F574C51E151D42008D5C4D /* libcrypto.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libcrypto.dylib; path = ../../../../usr/lib/libcrypto.dylib; sourceTree = ""; }; 87F574C71E151DA6008D5C4D /* libcommonCrypto.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libcommonCrypto.tbd; path = usr/lib/system/libcommonCrypto.tbd; sourceTree = SDKROOT; }; - 87F574CA1E151E97008D5C4D /* libfragmentzip.0.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libfragmentzip.0.dylib; path = ../../../../usr/local/lib/libfragmentzip.0.dylib; sourceTree = ""; }; 87F574CC1E151EF8008D5C4D /* libcorecrypto.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libcorecrypto.tbd; path = usr/lib/system/libcorecrypto.tbd; sourceTree = SDKROOT; }; 87F574CE1E151F11008D5C4D /* libSystem.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libSystem.tbd; path = usr/lib/libSystem.tbd; sourceTree = SDKROOT; }; /* End PBXFileReference section */ @@ -137,33 +153,42 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 878E1AC51F73EB3F00B1565B /* libzip.5.dylib in Frameworks */, - 878587AD1D89D59E008689F0 /* libz.tbd in Frameworks */, - 8788A6811EE8426A00138E07 /* libipatcher.0.dylib in Frameworks */, - 87F574D01E151F44008D5C4D /* libcrypto.dylib in Frameworks */, - 87F574CB1E151E97008D5C4D /* libfragmentzip.0.dylib in Frameworks */, - 878587B71D89D637008689F0 /* libirecovery.2.dylib in Frameworks */, - 878587AF1D89D5A5008689F0 /* libcurl.tbd in Frameworks */, - 878587AB1D89D590008689F0 /* libimobiledevice.6.dylib in Frameworks */, - 878587A71D89D56E008689F0 /* libplist.3.dylib in Frameworks */, + 56EF4C0F21B1A8850056D405 /* libfragmentzip.0.dylib in Frameworks */, + 5604B7B9219B35EE004C22EE /* libpartialzip-1.0.0.dylib in Frameworks */, + 56EF4C0D21B1A8750056D405 /* libusbmuxd.4.dylib in Frameworks */, + 5604B7C3219B3626004C22EE /* libplist.3.dylib in Frameworks */, + 5604B7C7219B3630004C22EE /* libz.tbd in Frameworks */, + 5604B7BB219B35F8004C22EE /* libirecovery.2.dylib in Frameworks */, + 5604B7C1219B3619004C22EE /* libz.1.2.11.dylib in Frameworks */, + 563DA64521BBE44900844624 /* libcrypto.3.dylib in Frameworks */, + 5604B7BF219B3611004C22EE /* libzip.5.0.dylib in Frameworks */, + 5604B7C9219B3632004C22EE /* libcurl.tbd in Frameworks */, + 5604B7C5219B362E004C22EE /* libimobiledevice.6.dylib in Frameworks */, + 5604B7BD219B3602004C22EE /* liblzfse.dylib in Frameworks */, + 56EF4C0921B1A8570056D405 /* libipatcher.0.dylib in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 561C73F221973D620030617C /* jssy */ = { + isa = PBXGroup; + children = ( + 56520BF321B1BB13005BD3F7 /* cmain.c */, + 56520BF521B1BB13005BD3F7 /* helper.h */, + 56520BF221B1BB13005BD3F7 /* jssy.c */, + 56520BF621B1BB13005BD3F7 /* jssy.cpp */, + 56520BF821B1BB13005BD3F7 /* jssy.h */, + 56520BF421B1BB13005BD3F7 /* jssy.hpp */, + 56520BF721B1BB13005BD3F7 /* ptr_smart.hpp */, + ); + name = jssy; + sourceTree = ""; + }; 8785873A1D89CFDC008689F0 = { isa = PBXGroup; children = ( - 8788A6821EE8544000138E07 /* jssy.c */, - 878587B61D89D637008689F0 /* libirecovery.2.dylib */, - 878587B41D89D5E6008689F0 /* libpartialzip-1.0.0.dylib */, - 878587B21D89D5D5008689F0 /* libzip.4.dylib */, - 878587AE1D89D5A5008689F0 /* libcurl.tbd */, - 878587AC1D89D59E008689F0 /* libz.tbd */, - 878587AA1D89D590008689F0 /* libimobiledevice.6.dylib */, - 878587A81D89D578008689F0 /* libirecovery.1.dylib */, - 878587A61D89D56E008689F0 /* libplist.3.dylib */, 878587451D89CFDC008689F0 /* futurerestore */, 878587441D89CFDC008689F0 /* Products */, 87F574C21E151CDE008D5C4D /* Frameworks */, @@ -193,6 +218,7 @@ 8785874D1D89D1A4008689F0 /* external */ = { isa = PBXGroup; children = ( + 561C73F221973D620030617C /* jssy */, 878587961D89D2BA008689F0 /* tsschecker */, 8785878B1D89D1ED008689F0 /* img4tool */, 8785874E1D89D1C1008689F0 /* idevicerestore */, @@ -251,11 +277,13 @@ 8785878B1D89D1ED008689F0 /* img4tool */ = { isa = PBXGroup; children = ( - 8785878C1D89D1ED008689F0 /* all_img4tool.h */, + 563DA64321BBE41C00844624 /* all.h */, 8785878F1D89D1ED008689F0 /* img4.h */, 8785878E1D89D1ED008689F0 /* img4.c */, 878587941D89D243008689F0 /* img4tool.h */, 878587901D89D1ED008689F0 /* img4tool.c */, + 56520BE921B1BA90005BD3F7 /* lzssdec.c */, + 56520BEA21B1BA90005BD3F7 /* lzssdec.h */, ); name = img4tool; path = external/img4tool/img4tool; @@ -264,11 +292,9 @@ 878587961D89D2BA008689F0 /* tsschecker */ = { isa = PBXGroup; children = ( - 878587971D89D2BA008689F0 /* all_tsschecker.h */, + 563DA64221BBE40700844624 /* all.h */, 878587991D89D2BA008689F0 /* download.h */, 878587981D89D2BA008689F0 /* download.c */, - 8785879B1D89D2BA008689F0 /* jsmn.h */, - 8785879A1D89D2BA008689F0 /* jsmn.c */, 878587A01D89D2BA008689F0 /* tsschecker.h */, 8785879F1D89D2BA008689F0 /* tsschecker.c */, ); @@ -279,13 +305,22 @@ 87F574C21E151CDE008D5C4D /* Frameworks */ = { isa = PBXGroup; children = ( - 878E1AC41F73EB3F00B1565B /* libzip.5.dylib */, - 8788A6801EE8426A00138E07 /* libipatcher.0.dylib */, + 5604B7C8219B3632004C22EE /* libcurl.tbd */, + 5604B7C6219B3630004C22EE /* libz.tbd */, + 5604B7BA219B35F8004C22EE /* libirecovery.2.dylib */, + 5604B7C0219B3619004C22EE /* libz.1.2.11.dylib */, + 5604B7B8219B35EE004C22EE /* libpartialzip-1.0.0.dylib */, + 5604B7C4219B362E004C22EE /* libimobiledevice.6.dylib */, + 5604B7BC219B3602004C22EE /* liblzfse.dylib */, + 5604B7C2219B3626004C22EE /* libplist.3.dylib */, + 5604B7BE219B3610004C22EE /* libzip.5.0.dylib */, + 56EF4C0821B1A8570056D405 /* libipatcher.0.dylib */, + 563DA64421BBE44900844624 /* libcrypto.3.dylib */, 87F574CE1E151F11008D5C4D /* libSystem.tbd */, 87F574CC1E151EF8008D5C4D /* libcorecrypto.tbd */, - 87F574CA1E151E97008D5C4D /* libfragmentzip.0.dylib */, 87F574C71E151DA6008D5C4D /* libcommonCrypto.tbd */, - 87F574C51E151D42008D5C4D /* libcrypto.dylib */, + 56EF4C0C21B1A8750056D405 /* libusbmuxd.4.dylib */, + 56EF4C0E21B1A8850056D405 /* libfragmentzip.0.dylib */, ); name = Frameworks; sourceTree = ""; @@ -300,6 +335,7 @@ 8785873F1D89CFDC008689F0 /* Sources */, 878587401D89CFDC008689F0 /* Frameworks */, 878587411D89CFDC008689F0 /* CopyFiles */, + 561C73F621973DC80030617C /* Version bump */, ); buildRules = ( ); @@ -316,7 +352,7 @@ 8785873B1D89CFDC008689F0 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0730; + LastUpgradeCheck = 1010; ORGANIZATIONNAME = tihmstar; TargetAttributes = { 878587421D89CFDC008689F0 = { @@ -329,7 +365,6 @@ developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( - en, ); mainGroup = 8785873A1D89CFDC008689F0; productRefGroup = 878587441D89CFDC008689F0 /* Products */; @@ -341,12 +376,33 @@ }; /* End PBXProject section */ +/* Begin PBXShellScriptBuildPhase section */ + 561C73F621973DC80030617C /* Version bump */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + ); + name = "Version bump"; + outputFileListPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "sed -i '.bak' \"s/.*define VERSION_COMMIT_COUNT_FUTURERESTORE.*/#define VERSION_COMMIT_COUNT_FUTURERESTORE \\\"$(git rev-list --count HEAD)\\\"/\" ./futurerestore/config.h 2>/dev/null || sed -i \"s/.*VERSION_COMMIT_COUNT_FUTURERESTORE.*/#define VERSION_COMMIT_COUNT_FUTURERESTORE \\\"$(git rev-list --count HEAD)\\\"/\" ./futurerestore/config.h 2>/dev/null\nsed -i '.bak' \"s/.*define VERSION_COMMIT_SHA_FUTURERESTORE.*/#define VERSION_COMMIT_SHA_FUTURERESTORE \\\"$(git rev-parse HEAD)\\\"/\" ./futurerestore/config.h 2>/dev/null || sed -i \"s/.*VERSION_COMMIT_SHA_FUTURERESTORE.*/#define VERSION_COMMIT_SHA_FUTURERESTORE \\\"$(git rev-parse HEAD)\\\"/\" ./futurerestore/config.h 2>/dev/null\n"; + }; +/* End PBXShellScriptBuildPhase section */ + /* Begin PBXSourcesBuildPhase section */ 8785873F1D89CFDC008689F0 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 8788A6831EE8544000138E07 /* jssy.c in Sources */, + 56520BFB21B1BB14005BD3F7 /* cmain.c in Sources */, 8799B0C11D89DB38002F4D5F /* fls.c in Sources */, 8799B0B41D89DAF6002F4D5F /* tss.c in Sources */, 8799B0C01D89DB38002F4D5F /* fdr.c in Sources */, @@ -358,20 +414,25 @@ 8799B0B81D89DAFF002F4D5F /* recovery.c in Sources */, 8799B0B31D89DAE7002F4D5F /* idevicerestore.c in Sources */, 8799B0C81D89E2BD002F4D5F /* img4tool.c in Sources */, + 56520BEF21B1BADE005BD3F7 /* endianness.h in Sources */, 8799B0BB1D89DB12002F4D5F /* download.c in Sources */, + 56520BEB21B1BA91005BD3F7 /* lzssdec.c in Sources */, 8799B0B71D89DAFF002F4D5F /* normal.c in Sources */, 8799B0C31D89DB4B002F4D5F /* socket.c in Sources */, 8799B0C21D89DB46002F4D5F /* thread.c in Sources */, 8799B0B61D89DAFF002F4D5F /* dfu.c in Sources */, 8799B0BD1D89DB27002F4D5F /* limera1n.c in Sources */, + 56520BF021B1BAE6005BD3F7 /* limera1n_payload.h in Sources */, 8799B0C51D89DB67002F4D5F /* locking.c in Sources */, 878587471D89CFDC008689F0 /* main.cpp in Sources */, 8799B0BF1D89DB38002F4D5F /* asr.c in Sources */, + 56520BFA21B1BB14005BD3F7 /* jssy.c in Sources */, 8799B0BE1D89DB27002F4D5F /* restore.c in Sources */, 8799B0CB1D89F796002F4D5F /* tsschecker.c in Sources */, 8799B0C91D89E2C3002F4D5F /* img4.c in Sources */, 8799B0CA1D89E371002F4D5F /* img4.c in Sources */, 8799B0B21D89D99D002F4D5F /* futurerestore.cpp in Sources */, + 56520BFC21B1BB14005BD3F7 /* jssy.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -387,13 +448,23 @@ CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = "-"; @@ -415,10 +486,25 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ( + /opt/local/include, + /usr/local/include, + /usr/local/opt/openssl/include, + ); + INSTALL_PATH = /usr/local/bin; + LIBRARY_SEARCH_PATHS = ( + /usr/lib, + /usr/local/lib, + /usr/local/opt/openssl/lib, + "$(SDKROOT)/usr/lib/system", + ); MACOSX_DEPLOYMENT_TARGET = 10.11; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; + PRODUCT_BUNDLE_IDENTIFIER = net.tihmstar.futurerestore; + PRODUCT_NAME = futurerestore; SDKROOT = macosx; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/external/tsschecker/external/jssy/jssy"; }; name = Debug; }; @@ -431,13 +517,23 @@ CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = "-"; @@ -453,9 +549,24 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ( + /opt/local/include, + /usr/local/include, + /usr/local/opt/openssl/include, + ); + INSTALL_PATH = /usr/local/bin; + LIBRARY_SEARCH_PATHS = ( + /usr/lib, + /usr/local/lib, + /usr/local/opt/openssl/lib, + "$(SDKROOT)/usr/lib/system", + ); MACOSX_DEPLOYMENT_TARGET = 10.11; MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_BUNDLE_IDENTIFIER = net.tihmstar.futurerestore; + PRODUCT_NAME = futurerestore; SDKROOT = macosx; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/external/tsschecker/external/jssy/jssy"; }; name = Release; }; @@ -463,17 +574,20 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; - HEADER_SEARCH_PATHS = ""; + HEADER_SEARCH_PATHS = ( + /usr/local/include, + /opt/local/include, + /usr/local/opt/openssl/include, + ); LIBRARY_SEARCH_PATHS = ( /usr/local/lib, /usr/lib, - /usr/local/opt/openssl/lib, "$(SDKROOT)/usr/lib/system", - /usr/local/Cellar/libzip/1.3.0/lib, ); OTHER_CFLAGS = "-DHAVE_LIBIPATCHER"; + PRODUCT_BUNDLE_IDENTIFIER = net.tihmstar.futurerestore; PRODUCT_NAME = "$(TARGET_NAME)"; - USER_HEADER_SEARCH_PATHS = "/usr/local/opt/openssl/include /usr/local/include $(SRCROOT)/external/tsschecker/external/jssy/jssy"; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/external/tsschecker/external/jssy/jssy $(SRCROOT)/external"; }; name = Debug; }; @@ -481,17 +595,20 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; - HEADER_SEARCH_PATHS = ""; + HEADER_SEARCH_PATHS = ( + /usr/local/include, + /opt/local/include, + /usr/local/opt/openssl/include, + ); LIBRARY_SEARCH_PATHS = ( /usr/local/lib, /usr/lib, - /usr/local/opt/openssl/lib, "$(SDKROOT)/usr/lib/system", - /usr/local/Cellar/libzip/1.3.0/lib, ); OTHER_CFLAGS = "-DHAVE_LIBIPATCHER"; + PRODUCT_BUNDLE_IDENTIFIER = net.tihmstar.futurerestore; PRODUCT_NAME = "$(TARGET_NAME)"; - USER_HEADER_SEARCH_PATHS = "/usr/local/opt/openssl/include /usr/local/include $(SRCROOT)/external/tsschecker/external/jssy/jssy"; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/external/tsschecker/external/jssy/jssy $(SRCROOT)/external"; }; name = Release; }; diff --git a/futurerestore.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/futurerestore.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 000000000..18d981003 --- /dev/null +++ b/futurerestore.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/futurerestore.xcodeproj/xcuserdata/s0uthwest.xcuserdatad/xcschemes/xcschememanagement.plist b/futurerestore.xcodeproj/xcuserdata/s0uthwest.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 000000000..19de8b07a --- /dev/null +++ b/futurerestore.xcodeproj/xcuserdata/s0uthwest.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,14 @@ + + + + + SchemeUserState + + futurerestore.xcscheme_^#shared#^_ + + orderHint + 0 + + + + diff --git a/futurerestore/futurerestore.hpp b/futurerestore/futurerestore.hpp index ef3c66e1b..f9f8b3689 100644 --- a/futurerestore/futurerestore.hpp +++ b/futurerestore/futurerestore.hpp @@ -126,7 +126,4 @@ class futurerestore { }; - - - #endif /* futurerestore_hpp */ diff --git a/futurerestore/main.cpp b/futurerestore/main.cpp index 244ee2a58..84f6f543d 100644 --- a/futurerestore/main.cpp +++ b/futurerestore/main.cpp @@ -1,4 +1,4 @@ - +// // main.cpp // futurerestore // From 303f6c7cc05670435fc3fd548d73f8053f4a4106 Mon Sep 17 00:00:00 2001 From: s0uthwest Date: Sat, 5 Jan 2019 06:35:23 -0800 Subject: [PATCH 02/69] Updated submodules TSSChecker/idevicerestore have Yonkers (A12) support and iOS 12. img4tool updated with kernelcache decompression and support watch 32bit kernel. Submodule 'img4tool' returned to original project --- external/idevicerestore | 2 +- external/img4tool | 2 +- external/tsschecker | 2 +- futurerestore/futurerestore.cpp | 4 +--- futurerestore/main.cpp | 1 - 5 files changed, 4 insertions(+), 7 deletions(-) diff --git a/external/idevicerestore b/external/idevicerestore index 396777645..5cb81a2d7 160000 --- a/external/idevicerestore +++ b/external/idevicerestore @@ -1 +1 @@ -Subproject commit 39677764510f5da14a4d5357204e0cd8575dae25 +Subproject commit 5cb81a2d753f917525e32839bc5e59f20c7cb12a diff --git a/external/img4tool b/external/img4tool index b3bb5040e..d908b9246 160000 --- a/external/img4tool +++ b/external/img4tool @@ -1 +1 @@ -Subproject commit b3bb5040e0defdc50ba66ace029910e48597efd8 +Subproject commit d908b92467ce783549dfbf8bb25dbe22afe074d2 diff --git a/external/tsschecker b/external/tsschecker index e2243e8d5..bab1ff295 160000 --- a/external/tsschecker +++ b/external/tsschecker @@ -1 +1 @@ -Subproject commit e2243e8d5256f9d1ba402069f10d0e0a0cd83d57 +Subproject commit bab1ff2954c2bbacdc3b5ab8860dea803e51c0e9 diff --git a/futurerestore/futurerestore.cpp b/futurerestore/futurerestore.cpp index 73e9ad604..8a6384a54 100644 --- a/futurerestore/futurerestore.cpp +++ b/futurerestore/futurerestore.cpp @@ -27,11 +27,9 @@ extern "C"{ #include "locking.h" #include "restore.h" #include "tsschecker.h" -#include "all_tsschecker.h" #include } - //(re)define __mkdir #ifdef __mkdir #undef __mkdir @@ -1596,4 +1594,4 @@ static int zip_test_file(zip_t *za, zip_uint64_t idx, zip_uint64_t size, zip_uin } return 0; -} \ No newline at end of file +} diff --git a/futurerestore/main.cpp b/futurerestore/main.cpp index 84f6f543d..d9f0f9b70 100644 --- a/futurerestore/main.cpp +++ b/futurerestore/main.cpp @@ -16,7 +16,6 @@ #include #include #include "futurerestore.hpp" -#include "all_tsschecker.h" #include "tsschecker.h" #ifdef HAVE_LIBIPATCHER #include From 7c1ee50ff7a1478321858ad8463920f3cb3525b3 Mon Sep 17 00:00:00 2001 From: s0uthwest Date: Sat, 5 Jan 2019 06:37:02 -0800 Subject: [PATCH 03/69] SEP alert as a baseband --- futurerestore/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/futurerestore/main.cpp b/futurerestore/main.cpp index d9f0f9b70..697d8cc17 100644 --- a/futurerestore/main.cpp +++ b/futurerestore/main.cpp @@ -99,7 +99,7 @@ int main(int argc, const char * argv[]) { int err=0; int res = -1; - printf("Version: " VERSION_COMMIT_SHA_FUTURERESTORE" - " VERSION_COMMIT_COUNT_FUTURERESTORE"\n"); + printf("Version: " VERSION_COMMIT_SHA_FUTURERESTORE" - " VERSION_COMMIT_COUNT_FUTURERESTORE"\n"); // versioning #ifdef HAVE_LIBIPATCHER printf("%s\n",libipatcher::version().c_str()); printf("Odysseus Support: yes\n"); @@ -247,7 +247,7 @@ int main(int argc, const char * argv[]) { devVals.deviceBoard = const_cast(device->hardware_model); if (flags & FLAG_LATEST_SEP) { - info("user specified to use latest signed sep\n"); + info("user specified to use latest signed sep (WARNING, THIS CAN CAUSE A NON-WORKING RESTORE)\n"); client.loadLatestSep(); } else if (!client.is32bit()) { if (sourceIpswPath != nullptr) { From 5a95cb19bd397063a892d18f38d26110d6b7b3d6 Mon Sep 17 00:00:00 2001 From: s0uthwest Date: Sat, 5 Jan 2019 06:37:41 -0800 Subject: [PATCH 04/69] 10 second timer for non-bb restoring --- futurerestore/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/futurerestore/main.cpp b/futurerestore/main.cpp index 697d8cc17..0f13dca67 100644 --- a/futurerestore/main.cpp +++ b/futurerestore/main.cpp @@ -265,7 +265,7 @@ int main(int argc, const char * argv[]) { if (flags & FLAG_NO_BASEBAND){ printf("\nWARNING: user specified not to flash a baseband. This can make the restore fail if the device needs a baseband!\n"); printf("if you added this flag by mistake you can press CTRL-C now to cancel\n"); - int c = 5; + int c = 10; printf("continuing restore in "); while (c) { printf("%d ",c--); From 845536c62ad84dd803cf0b028fe0acfe59e17db6 Mon Sep 17 00:00:00 2001 From: s0uthwest Date: Sat, 5 Jan 2019 06:39:39 -0800 Subject: [PATCH 05/69] Actualizing help --- LICENSE => LICENSE.txt | 0 README.md | 168 ++++++++++++++++++++++------------------- futurerestore/main.cpp | 8 +- 3 files changed, 94 insertions(+), 82 deletions(-) rename LICENSE => LICENSE.txt (100%) diff --git a/LICENSE b/LICENSE.txt similarity index 100% rename from LICENSE rename to LICENSE.txt diff --git a/README.md b/README.md index 65713c4c6..c563b9ac5 100644 --- a/README.md +++ b/README.md @@ -1,47 +1,15 @@ # futurerestore _futurerestore is a hacked up idevicerestore wrapper, which allows manually specifying SEP and Baseband for restoring_ -Latest compiled version can be found here: -(macOS & Windows) -https://github.com/encounter/futurerestore/releases - +Only use if you are sure what you're doing. --- -# Features +## Features * Supports the following downgrade methods - * Prometheus 64bit devices (generator and nonce collision mode) - * Odysseus for 32bit devices - * Re-restoring 32bit devices to iOS 9 with @alitek123's no-nonce method -* Allows restoring any nonmatching signed iOS/Sep/Baseband - -# Help -_(might become outdated):_ - -``` -Usage: futurerestore [OPTIONS] /path/to/ipsw - -Options: - - -t, --apticket PATH APTicket used for restoring - -u, --update Update instead of erase install (requires appropriate APTicket) - -w, --wait Keep rebooting until nonce matches APTicket (nonce collision, unreliable) - -d, --debug Verbose debug output (useful for error logs) - --latest-sep Use latest signed sep instead of manually specifying one (may cause bad restore) - --latest-baseband Use latest signed baseband instead of manually specifying one (may cause bad restore) - --no-baseband Skip checks and don't flash baseband - WARNING: only use this for device without a baseband (eg. iPod or some wifi only iPads) - -To extract baseband/SEP automatically from IPSW: - - -i, --source-ipsw PATH Source IPSW to extract baseband/SEP from - -To manually specify baseband/SEP: - - -b, --baseband PATH Baseband to be flashed - -p, --baseband-manifest PATH BuildManifest for requesting baseband ticket - -s, --sep PATH SEP to be flashed - -m, --sep-manifest PATH BuildManifest for requesting sep ticket -``` + * Prometheus 64-bit devices (generator and APNonce collision mode); + * Odysseus for 32-bit devices; + * Re-restoring 32-bit devices to iOS 9 with @alitek123's no-nonce method (alternative — [idevicererestore](https://github.com/s0uthwest/idevicererestore)). +* Allows restoring any nonmatching signed iOS/SEP/Baseband. # Dependencies * ## Runtime @@ -49,18 +17,21 @@ To manually specify baseband/SEP: * On Linux, [usbmuxd](https://github.com/libimobiledevice/usbmuxd) is required at runtime. * ## External Libs Make sure these are installed - * libzip - * libcurl - * openssl (or CommonCrypto on OSX) - * [libplist](https://github.com/libimobiledevice/libplist) + * [libzip](https://github.com/nih-at/libzip); + * [libcurl](https://github.com/curl/curl); + * [openssl](https://github.com/openssl/openssl) (or CommonCrypto on macOS/OS X); + * [libplist](https://github.com/libimobiledevice/libplist); + * [libirecovery](https://github.com/s0uthwest/libirecovery); + * [libimobiledevice](https://github.com/libimobiledevice/libimobiledevice) * ## Submodules Make sure these projects compile on your system (install their dependencies) - * [tsschecker](https://github.com/encounter/tsschecker) - * [img4tool](https://github.com/tihmstar/img4tool) - * [idevicerestore](https://github.com/encounter/idevicerestore) - -# Building from source -See [COMPILING.md](COMPILING.md) + * [jssy](https://github.com/tihmstar/jssy); + * [tsschecker](https://github.com/s0uthwest/tsschecker); + * [img4tool](https://github.com/s0uthwest/img4tool); + * [idevicerestore](https://github.com/s0uthwest/idevicerestore) + +## Some about curl for ubuntu +Follow [this guide](https://dev.to/jake/using-libcurl3-and-libcurl4-on-ubuntu-1804-bionic-184g) to use tsschecker on Ubuntu 18.04 (Bionic) as it requires libcurl3 which cannot coexist with libcurl4 on this OS. --- @@ -70,10 +41,10 @@ Whenever you read "downgrade" nowadays it means you can also upgrade and re-rest --- -## 1) Prometheus (64bit device) - generator method +## 1) Prometheus (64-bit device) - generator method ### Requirements -- Jailbreak +- __Jailbreak__ - SHSH2 files with a generator - nonceEnabler patch enabled @@ -84,7 +55,7 @@ You can downgrade if the destination iOS is compatible with the latest signed SE 1. Device must be jailbroken and nonceEnabler patch must be active 2. Open shsh file and look up the generator * Looks like this: `generator0xde3318d224cf14a1` -3. Write the generator to device's NVRAM +3. Write the generator to device's nvram * SSH into the device and run `nvram com.apple.System.boot-nonce=0xde3318d224cf14a1` to set the generator *0xde3318d224cf14a1* * verify with `nvram -p` 4. Connect your device in normal mode to computer @@ -94,31 +65,42 @@ You can downgrade if the destination iOS is compatible with the latest signed SE Prometheus *Prometheus* -Prometheus -*NonceEnabler* - ### Recommended method to active nonceEnabler patch -1. Get nvpatch https://github.com/Siguza/ios-kern-utils/releases/ +#### Method 1: ios-kern-utils (iOS 7.x-10.x) +1. Install DEB-file of [ios-kern-utils](https://github.com/Siguza/ios-kern-utils/releases/) on device 2. Run on the device `nvpatch com.apple.System.boot-nonce` +#### Method 2: Using special applications +Use utilities for setting boot-nonce — [PhœnixNonce](https://github.com/Siguza/PhoenixNonce) for iOS 9.x, [v0rtexnonce](https://github.com/arx8x/v0rtexnonce) for iOS 10.x, [nonceset1112](https://github.com/julioverne/NonceSet112) for iOS 11.0-11.1.2 and [noncereboot1131UI](https://github.com/s0uthwest/noncereboot1131UI) for iOS 11.0-11.4b3. + +#### Method 3: [noncereboot11](https://github.com/pwn20wndstuff/noncereboot11) for iOS 11.x. +This CLI tool available at [pwn20wnd](https://github.com/pwn20wndstuff)'s [Cydia repo](http://xnu.science/repo). Install it and set boot-nonce with help on the binary. + ### Activate tfp0 if jailbreak doesn't allow it #### Method 1 (if jailbroken on 9.3.x) * reboot - * reactivate jailbreak with https://jbme.qwertyoruiop.com/ + * reactivate jailbreak with [Luca Todesco](https://github.com/kpwn)'s [JailbreakMe](https://jbme.qwertyoruiop.com/) * done + +#### Method 2 (if jailbroken on iOS 8.0-8.1 with [Pangu](https://en.8.pangu.io)) + * install this [untether DEB-file](http://apt.saurik.com/beta/pangu8-tfp0/io.pangu.xuanyuansword8_0.5_iphoneos-arm.deb) with included tfp0 patch + +#### Method 3 (if jailbroken on iOS 7.x with [Pangu](https://en.7.pangu.io)) + * install this [untether DEB-file](http://apt.saurik.com/debs/io.pangu.axe7_0.3_iphoneos-arm.deb) with included tfp0 patch -#### Method 2 - * Use cl0ver (https://github.com/Siguza/cl0ver) +#### Method 4 + * Use [cl0ver](https://github.com/Siguza/cl0ver) for iOS 9.x --- -## 2) Prometheus (64bit device) - nonce collision method +## 2) Prometheus (64-bit device) - APNonce collision method (Recovery) ### Requirements -- iPhone5s or iPad Air on iOS 9.1 - 10.2 +- __iPhone 5s, iPad Air, iPad mini 2 on iOS 9.1 - 10.2__ - No Jailbreak required - SHSH files with customly chosen APNonce -- The shsh file needs to have one of the nonces, which the device generates a lot +- The shsh file needs to have one of the APNnces, which the device generates a lot +- __collisioned APNonces available in file 'nonces.txt'__ ### Info You can downgrade if the destination iOS is compatible with the latest signed SEP. You also need to have special shsh files. If you don't know what this is, you probably can **NOT** use this method! @@ -131,24 +113,60 @@ one to speed up the process: `futurerestore -w -t t1.shsh -t t2.shsh -t t3.shsh --- -## 3) Odysseus (32bit devices) +## 3) Prometheus (64-bit device) - APNonce collision method (DFU) + +### Requirements +- __Devices for A7 chip (iPhone 5s, iPad Air, iPad mini 2) and some devices with A8 chip (iPod touch [6th gen]) on all iOS firmwares__ +- No Jailbreak required +- SHSH files with customly chosen APNonce +- The shsh file needs to have one of the APNnces, which the device generates a lot +- __[img4tool](https://github.com/s0uthwest/img4tool) can't be used for Windows [problem with signing iBSS/iBEC], now it's TO-DO__ +- __collisioned APNonces available in file 'nonces.txt' in [TSSChecker](https://github.com/s0uthwest/TSSChecker).__ + +### Info +You can downgrade if the destination iOS is compatible with the latest signed SEP. You also need to have special shsh files. If you don't know what this is, you probably can **NOT** use this method! + +### How to use +1. Connect your device in DFU mode +2. Use [irecovery](https://github.com/libimobiledevice/irecovery) for check nonce booted with DFU +3. Extract iBSS/iBEC from target firmware for downgrade (unsigned) +4. Check DFU APNonces with [irecovery](https://github.com/libimobiledevice/irecovery) with DFU booting. + You can't automatically collision DFU APNonces. + + __If APNonce is not collisioned, "use hands" for DFU booting.__ + + __If APNonce is successfully coliisioned, use this SHSH2 for sign iBSS/iBEC.__ +5. Use [img4tool](https://github.com/s0uthwest/img4tool) for sign iBSS: + `img4tool -s ticket.shsh -c iBSS.signed -p ` +6. Use [img4tool](https://github.com/s0uthwest/img4tool) for sign iBEC: + `img4tool -s ticket.shsh -c iBEC.signed -p ` +7. So, after signing we can boot into Recovery with [irecovery](https://github.com/libimobiledevice/irecovery): + + `irecovery -f iBSS.signed` - loading iBSS + + `irecovery -f iBEC.signed` - loading iBEC +8. So good! On the computer run `futurerestore -w -t ticket.shsh --latest-baseband --latest-sep ios.ipsw` + +--- + +## 4) Odysseus (32-bit devices) ### Requirements -- futurerestore compiled with libipatcher (odysseus support) +- futurerestore compiled with libipatcher ([Odysseus](https://dayt0n.com/articles/Odysseus) support) - Jailbreak or bootrom exploit (limera1n) -- Firmware keys for the device/destination iOS must be public (check ipsw.me) +- Firmware keys for the device/destination iOS must be public - SHSH files for the destination iOS (OTA blobs work too!) ### Info -If you have a jailbroken 32bit device you can downgrade to any iOS you have blobs for. You can still get OTA blobs for iOS 6.1.3 and 8.4.1 for some devices and use those. +If you have a jailbroken 32-bit device you can downgrade to any iOS you have blobs for. You can still get OTA blobs for iOS 6.1.3 and 8.4.1 for some devices and use those. ### How to use 1. Get device into kDFU/pwnDFU - * Pre-iPhone4s (limera1n devices): + * Pre-iPhone 4s (limera1n devices): * Enter pwndfu mode with redsn0w or any other tool - * iPhone4s and later: + * iPhone 4s and later: * Jailbreak required! - * Enter kDFU mode with kDFU app (cydia: repo.tihmstar.net) or by loading a pwniBSS from any existing odysseus bundle. + * Enter kDFU mode by loading a pwnediBSS from any existing odysseus bundle. 2. Connect your device to computer in kDFU mode (or pwnDFU mode) 3. On the computer run `futurerestore --use-pwndfu -t ticket.shsh --latest-baseband ios.ipsw` @@ -156,21 +174,15 @@ If you have a jailbroken 32bit device you can downgrade to any iOS you have blob Odysseus *Futurerestore + Libipatcher* -Odysseus -*kDFU App* - -Odysseus -*Enter kDFU Mode (watch up to the point where the screen goes black)* - -*You can use **any** odysseus bundle for this* +*You can use **any** successfully created odysseus bundle for this* -## 4) iOS 9 Re-restore bug (found by @alitek123) (32bit devices): +## 5) iOS 9 Re-restore bug (found by [@alitek123](https://twitter.com/alitek123), 32-bit devices only): ### Requirements - No Jailbreak required -- SHSH files without a nonce (noNonce APTickets) +- __SHSH files without a APNonce (noNonce APTickets)__ ### Info -If you have shsh files for iOS9 which do not contain a nonce, you can restore to that firmware. +If you have shsh files for iOS9 which do not contain an APNonce, you can restore to that firmware. ### How to use 1. Connect your device in DFU mode diff --git a/futurerestore/main.cpp b/futurerestore/main.cpp index 0f13dca67..8c8d0caee 100644 --- a/futurerestore/main.cpp +++ b/futurerestore/main.cpp @@ -60,20 +60,20 @@ static struct option longopts[] = { void cmd_help(){ printf("Usage: futurerestore [OPTIONS] /path/to/ipsw\n\n"); + printf("Tool, which supported latest restore unsigned firmware methods for all iOS devices.\n\n"); printf("Options:\n\n"); - printf(" -t, --apticket PATH\t\tAPTicket used for restoring\n"); printf(" -u, --update\t\t\tUpdate instead of erase install (requires appropriate APTicket)\n"); - printf(" -w, --wait\t\t\tKeep rebooting until nonce matches APTicket (nonce collision, unreliable)\n"); + printf(" -w, --wait\t\t\tKeep rebooting until ApNonce matches APTicket (ApNonce collision, unreliable)\n"); printf(" -d, --debug\t\t\tVerbose debug output (useful for error logs)\n"); printf(" --latest-sep\t\tUse latest signed sep instead of manually specifying one (may cause bad restore)\n"); printf(" --latest-baseband\t\tUse latest signed baseband instead of manually specifying one (may cause bad restore)\n"); printf(" --no-baseband\t\tSkip checks and don't flash baseband\n"); - printf(" \t\tWARNING: only use this for device without a baseband (eg. iPod or some wifi only iPads)\n"); + printf(" \t\tWARNING: only use this for device without a baseband (eg. iPod touch or some Wi-Fi only iPads)\n"); printf(" --exit-recovery\t\tExit recovery mode and quit\n"); #ifdef HAVE_LIBIPATCHER printf(" --use-pwndfu\t\tuse this for restoring devices with odysseus method. Device needs to be in kDFU mode already\n"); - printf(" --just-boot=\"-v\"\t\tuse this to tethered boot the device from kDFU mode. You can optionally set bootargs\n"); + printf(" --just-boot=\"-v\"\t\tuse this to tethered boot the device from kDFU mode. You can optionally set boot-args\n"); #endif printf("\nTo extract baseband/SEP automatically from IPSW:\n\n"); printf(" -i, --source-ipsw PATH\tSource IPSW to extract baseband/SEP from\n"); From c1f9d4c354e361b1a20b3c6312c235d303d9c8dd Mon Sep 17 00:00:00 2001 From: s0uthwest Date: Sat, 5 Jan 2019 06:44:29 -0800 Subject: [PATCH 06/69] semi-fix PRIu64 --- futurerestore/futurerestore.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/futurerestore/futurerestore.cpp b/futurerestore/futurerestore.cpp index 8a6384a54..50a437eff 100644 --- a/futurerestore/futurerestore.cpp +++ b/futurerestore/futurerestore.cpp @@ -1564,7 +1564,7 @@ static int zip_test_file(zip_t *za, zip_uint64_t idx, zip_uint64_t size, zip_uin zip_uint32_t ncrc; if ((zf = zip_fopen_index(za, idx, 0)) == NULL) { - fprintf(stderr, "cannot open file %" PRIu64 " in archive: %s\n", idx, zip_strerror(za)); + // fprintf(stderr, "cannot open file %" PRIu64 " in archive: %s\n", idx, zip_strerror(za)); return -1; } @@ -1577,7 +1577,7 @@ static int zip_test_file(zip_t *za, zip_uint64_t idx, zip_uint64_t size, zip_uin } if (n < 0) { - fprintf(stderr, "error reading file %" PRIu64 " in archive: %s\n", idx, zip_file_strerror(zf)); + // fprintf(stderr, "error reading file %" PRIu64 " in archive: %s\n", idx, zip_file_strerror(zf)); zip_fclose(zf); return -1; } @@ -1585,11 +1585,11 @@ static int zip_test_file(zip_t *za, zip_uint64_t idx, zip_uint64_t size, zip_uin zip_fclose(zf); if (nsize != size) { - fprintf(stderr, "file %" PRIu64 ": unexpected length %" PRId64 " (should be %" PRId64 ")\n", idx, nsize, size); + // fprintf(stderr, "file %" PRIu64 ": unexpected length %" PRId64 " (should be %" PRId64 ")\n", idx, nsize, size); return -2; } if (ncrc != crc) { - fprintf(stderr, "file %" PRIu64 ": unexpected length %x (should be %x)\n", idx, ncrc, crc); + // fprintf(stderr, "file %" PRIu64 ": unexpected length %x (should be %x)\n", idx, ncrc, crc); return -2; } From c45b37ca5ddecf027419d255a400054a1aab02b4 Mon Sep 17 00:00:00 2001 From: s0uthwest Date: Sat, 5 Jan 2019 06:53:50 -0800 Subject: [PATCH 07/69] Added libfragmentzip compiler to fix tsschecker submodule --- configure.ac | 1 + external/tsschecker | 2 +- futurerestore/Makefile.am | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 48d765825..ef8c5b265 100644 --- a/configure.ac +++ b/configure.ac @@ -32,6 +32,7 @@ AC_SEARCH_LIBS([pthread_create], [pthread]) PKG_CHECK_MODULES(libplist, libplist >= 1.12) PKG_CHECK_MODULES(libzip, libzip >= 0.10) PKG_CHECK_MODULES(libimobiledevice, libimobiledevice-1.0 >= 1.2.1) +PKG_CHECK_MODULES(libfragmentzip, libfragmentzip >= 1.0) PKG_CHECK_MODULES(libirecovery, libirecovery >= 0.2.0) AC_PROG_CC diff --git a/external/tsschecker b/external/tsschecker index bab1ff295..2edcfb9f7 160000 --- a/external/tsschecker +++ b/external/tsschecker @@ -1 +1 @@ -Subproject commit bab1ff2954c2bbacdc3b5ab8860dea803e51c0e9 +Subproject commit 2edcfb9f721f65096ed0913ee17eb05bf9a35be6 diff --git a/futurerestore/Makefile.am b/futurerestore/Makefile.am index 2db56f1a5..60359bb40 100644 --- a/futurerestore/Makefile.am +++ b/futurerestore/Makefile.am @@ -1,5 +1,5 @@ -AM_CFLAGS = $(libplist_CFLAGS) $(libzip_CFLAGS) $(libimobiledevice_CFLAGS) $(libfragmentzip_CFLAGS) $(libirecovery_CFLAGS) -I$(top_srcdir)/external/tsschecker/external/jssy/jssy -I$(top_srcdir)/external/tsschecker/tsschecker -I$(top_srcdir)/external/img4tool/img4tool -I$(top_srcdir)/external/idevicerestore/src -std=c++11 -AM_LDFLAGS = $(libplist_LIBS) $(libzip_LIBS) $(libimobiledevice_LIBS) $(libfragmentzip_LIBS) $(libirecovery_LIBS) +AM_CFLAGS = $(libplist_CFLAGS) $(libzip_CFLAGS) $(libimobiledevice_CFLAGS) $(libfragmentzip_CFLAGS) $(libirecovery_CFLAGS) $(libfragmentzip_CFLAGS) -I$(top_srcdir)/external/tsschecker/external/jssy/jssy -I$(top_srcdir)/external/tsschecker/tsschecker -I$(top_srcdir)/external/img4tool/img4tool -I$(top_srcdir)/external/idevicerestore/src -std=c++11 +AM_LDFLAGS = $(libplist_LIBS) $(libzip_LIBS) $(libimobiledevice_LIBS) $(libfragmentzip_LIBS) $(libirecovery_LIBS) $(libfragmentzip_LIBS) if HAVE_LIBIPATCHER AM_LDFLAGS += $(libipatcher_LIBS) From 0703c8eba3295604b5b18b59b3420bb788e1fc8e Mon Sep 17 00:00:00 2001 From: s0uthwest Date: Sat, 5 Jan 2019 07:54:47 -0800 Subject: [PATCH 08/69] fix 'decompress_lzss' uncompatibilty with libipatcher --- .gitmodules | 2 +- external/img4tool | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index fe901c9ee..b31f3b669 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,6 @@ [submodule "external/img4tool"] path = external/img4tool - url = https://github.com/tihmstar/img4tool.git + url = https://github.com/s0uthwest/img4tool.git [submodule "external/tsschecker"] path = external/tsschecker url = https://github.com/s0uthwest/tsschecker.git diff --git a/external/img4tool b/external/img4tool index d908b9246..365bf7d88 160000 --- a/external/img4tool +++ b/external/img4tool @@ -1 +1 @@ -Subproject commit d908b92467ce783549dfbf8bb25dbe22afe074d2 +Subproject commit 365bf7d888711c58b87c2070ec022e01dbec5341 From f6a921dc711e5a82b6985c1b167ed7cdf1caea3b Mon Sep 17 00:00:00 2001 From: s0uthwest <42713499+s0uthwest@users.noreply.github.com> Date: Sat, 5 Jan 2019 20:08:01 +0300 Subject: [PATCH 09/69] configure: info --- configure.ac | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index ef8c5b265..3f1261a4a 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ AC_PREREQ(2.64) -AC_INIT([futurerestore], [1.0], [https://github.com/encounter/futurerestore/issues],, [https://github.com/encounter/futurerestore]) +AC_INIT([futurerestore], [1.0], [https://github.com/s0uthwest/futurerestore/issues],, [https://github.com/s0uthwest/futurerestore]) AC_CANONICAL_SYSTEM @@ -38,7 +38,6 @@ PKG_CHECK_MODULES(libirecovery, libirecovery >= 0.2.0) AC_PROG_CC AC_PROG_CXX - # Optional module libipatcher AC_ARG_WITH([libipatcher], [AS_HELP_STRING([--without-libipatcher], @@ -82,7 +81,6 @@ Makefile futurerestore/Makefile ]) - echo " Configuration for $PACKAGE $VERSION: ------------------------------------------- From 0ef13e2ac775cc1950e99d8f447ad9a2b57dd01d Mon Sep 17 00:00:00 2001 From: GeoSn0w Date: Sun, 6 Jan 2019 05:29:47 +0100 Subject: [PATCH 10/69] Removed windows reference since windows is not supported. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c563b9ac5..6d7442e4c 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ Only use if you are sure what you're doing. # Dependencies * ## Runtime - * On macOS and Windows, futurerestore requires no runtime dependencies, the following are only for compiling. + * On macOS, futurerestore requires no runtime dependencies, the following are only for compiling. * On Linux, [usbmuxd](https://github.com/libimobiledevice/usbmuxd) is required at runtime. * ## External Libs Make sure these are installed From cec8021121d6dee5347ac683c2bfb7e0878e5962 Mon Sep 17 00:00:00 2001 From: s0uthwest <42713499+s0uthwest@users.noreply.github.com> Date: Sun, 6 Jan 2019 09:39:05 +0300 Subject: [PATCH 11/69] More about windows version --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 6d7442e4c..032873d8d 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,8 @@ _futurerestore is a hacked up idevicerestore wrapper, which allows manually spec Only use if you are sure what you're doing. --- +Windows version is supported, but I will not compile it. +--- ## Features * Supports the following downgrade methods From cad6703a09633951a56f24336e7225d7a3f7faeb Mon Sep 17 00:00:00 2001 From: s0uthwest <42713499+s0uthwest@users.noreply.github.com> Date: Sun, 6 Jan 2019 10:27:34 +0300 Subject: [PATCH 12/69] ReadMe: update external libs --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 032873d8d..ebaec4d74 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Windows version is supported, but I will not compile it. * Prometheus 64-bit devices (generator and APNonce collision mode); * Odysseus for 32-bit devices; * Re-restoring 32-bit devices to iOS 9 with @alitek123's no-nonce method (alternative — [idevicererestore](https://github.com/s0uthwest/idevicererestore)). -* Allows restoring any nonmatching signed iOS/SEP/Baseband. +* Allows restoring any non-matching signed iOS/SEP/Baseband. # Dependencies * ## Runtime @@ -20,8 +20,7 @@ Windows version is supported, but I will not compile it. * ## External Libs Make sure these are installed * [libzip](https://github.com/nih-at/libzip); - * [libcurl](https://github.com/curl/curl); - * [openssl](https://github.com/openssl/openssl) (or CommonCrypto on macOS/OS X); + * [libfragmentzip](https://github.com/encounter/libfragmentzip); * [libplist](https://github.com/libimobiledevice/libplist); * [libirecovery](https://github.com/s0uthwest/libirecovery); * [libimobiledevice](https://github.com/libimobiledevice/libimobiledevice) From 8b7eca22b449468a4405ae3df79ff5e7ef35f0d5 Mon Sep 17 00:00:00 2001 From: s0uthwest Date: Sun, 6 Jan 2019 10:08:16 -0800 Subject: [PATCH 13/69] new copyrights --- futurerestore/main.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/futurerestore/main.cpp b/futurerestore/main.cpp index 8c8d0caee..750cd6099 100644 --- a/futurerestore/main.cpp +++ b/futurerestore/main.cpp @@ -59,7 +59,7 @@ static struct option longopts[] = { #define FLAG_IS_PWN_DFU 1 << 5 void cmd_help(){ - printf("Usage: futurerestore [OPTIONS] /path/to/ipsw\n\n"); + printf("Usage: futurerestore [OPTIONS] /path/to/ipsw\n"); printf("Tool, which supported latest restore unsigned firmware methods for all iOS devices.\n\n"); printf("Options:\n\n"); printf(" -t, --apticket PATH\t\tAPTicket used for restoring\n"); @@ -83,7 +83,8 @@ void cmd_help(){ printf(" -s, --sep PATH\t\tSEP to be flashed\n"); printf(" -m, --sep-manifest PATH\tBuildManifest for requesting sep ticket\n"); printf("\n"); - printf("Homepage: <" PACKAGE_URL ">\n"); + printf("Homepage: https://github.com/s0uthwest/futurerestore\n"); + printf("Original project: https://github.com/tihmstar/futurerestore\n"); } using namespace std; From 09b2eb3ff78b294ce393d20ac4d4dd53d476b7b1 Mon Sep 17 00:00:00 2001 From: s0uthwest Date: Sun, 6 Jan 2019 10:08:38 -0800 Subject: [PATCH 14/69] TSSChecker: removed non-required nonceLen --- README.md => ReadMe.md | 0 external/tsschecker | 2 +- futurerestore/futurerestore.cpp | 2 -- 3 files changed, 1 insertion(+), 3 deletions(-) rename README.md => ReadMe.md (100%) diff --git a/README.md b/ReadMe.md similarity index 100% rename from README.md rename to ReadMe.md diff --git a/external/tsschecker b/external/tsschecker index 2edcfb9f7..383c9eba2 160000 --- a/external/tsschecker +++ b/external/tsschecker @@ -1 +1 @@ -Subproject commit 2edcfb9f721f65096ed0913ee17eb05bf9a35be6 +Subproject commit 383c9eba295e4348115571f0ed58482701d2ef9e diff --git a/futurerestore/futurerestore.cpp b/futurerestore/futurerestore.cpp index 50a437eff..13a321d68 100644 --- a/futurerestore/futurerestore.cpp +++ b/futurerestore/futurerestore.cpp @@ -260,8 +260,6 @@ const char *futurerestore::nonceMatchesIM4Ms(){ return NULL; } - - void futurerestore::waitForNonce(vectornonces, size_t nonceSize){ if (!_didInit) reterror(-1, "did not init\n"); setAutoboot(false); From f389f1f3ac42483b8be1922f19f2033ea80df7a1 Mon Sep 17 00:00:00 2001 From: s0uthwest Date: Mon, 7 Jan 2019 00:32:08 -0800 Subject: [PATCH 15/69] img4tool: fix error '-44' --- external/img4tool | 2 +- external/tsschecker | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/external/img4tool b/external/img4tool index 365bf7d88..e745a7679 160000 --- a/external/img4tool +++ b/external/img4tool @@ -1 +1 @@ -Subproject commit 365bf7d888711c58b87c2070ec022e01dbec5341 +Subproject commit e745a76799ee243b1e6759e51c501d051fab885f diff --git a/external/tsschecker b/external/tsschecker index 383c9eba2..8ca27c480 160000 --- a/external/tsschecker +++ b/external/tsschecker @@ -1 +1 @@ -Subproject commit 383c9eba295e4348115571f0ed58482701d2ef9e +Subproject commit 8ca27c4802ae0e6ab4d32b20879c7fdb7b67e42a From 9495c148602a89261c07b81cf46208c6ebbd1537 Mon Sep 17 00:00:00 2001 From: s0uthwest Date: Mon, 7 Jan 2019 00:47:07 -0800 Subject: [PATCH 16/69] ReadMe & Xcode: actualizing --- ReadMe.md | 55 +++++++++++------- futurerestore.xcodeproj/project.pbxproj | 6 ++ .../UserInterfaceState.xcuserstate | Bin 0 -> 10027 bytes futurerestore/futurerestore.hpp | 1 - 4 files changed, 40 insertions(+), 22 deletions(-) create mode 100644 futurerestore.xcodeproj/project.xcworkspace/xcuserdata/s0uthwest.xcuserdatad/UserInterfaceState.xcuserstate diff --git a/ReadMe.md b/ReadMe.md index ebaec4d74..ed399d5ab 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -3,8 +3,8 @@ _futurerestore is a hacked up idevicerestore wrapper, which allows manually spec Only use if you are sure what you're doing. --- -Windows version is supported, but I will not compile it. ---- +Latest release available [here](https://github.com/s0uthwest/futurerestore/releases) for macOS & Linux. +__Windows version is supported, but I will not compile it.__ ## Features * Supports the following downgrade methods @@ -31,8 +31,14 @@ Windows version is supported, but I will not compile it. * [img4tool](https://github.com/s0uthwest/img4tool); * [idevicerestore](https://github.com/s0uthwest/idevicerestore) -## Some about curl for ubuntu -Follow [this guide](https://dev.to/jake/using-libcurl3-and-libcurl4-on-ubuntu-1804-bionic-184g) to use tsschecker on Ubuntu 18.04 (Bionic) as it requires libcurl3 which cannot coexist with libcurl4 on this OS. +## Report an issue +You can do it [here](https://github.com/s0uthwest/futurerestore/issues). + +## Compiling +Simple use `bash autogen.sh && make` or use Xcode project. + +### Some about curl for ubuntu +Follow [this guide](https://dev.to/jake/using-libcurl3-and-libcurl4-on-ubuntu-1804-bionic-184g) to use tsschecker on Ubuntu 18.04 (Bionic) as it requires libcurl3 which cannot co-exist with libcurl4 on this OS. --- @@ -83,10 +89,10 @@ This CLI tool available at [pwn20wnd](https://github.com/pwn20wndstuff)'s [Cydia * reactivate jailbreak with [Luca Todesco](https://github.com/kpwn)'s [JailbreakMe](https://jbme.qwertyoruiop.com/) * done -#### Method 2 (if jailbroken on iOS 8.0-8.1 with [Pangu](https://en.8.pangu.io)) +#### Method 2 (if jailbroken on iOS 8.0-8.1 with [Pangu8](https://en.8.pangu.io)) * install this [untether DEB-file](http://apt.saurik.com/beta/pangu8-tfp0/io.pangu.xuanyuansword8_0.5_iphoneos-arm.deb) with included tfp0 patch -#### Method 3 (if jailbroken on iOS 7.x with [Pangu](https://en.7.pangu.io)) +#### Method 3 (if jailbroken on iOS 7.x with [Pangu7](https://en.7.pangu.io)) * install this [untether DEB-file](http://apt.saurik.com/debs/io.pangu.axe7_0.3_iphoneos-arm.deb) with included tfp0 patch #### Method 4 @@ -94,14 +100,14 @@ This CLI tool available at [pwn20wnd](https://github.com/pwn20wndstuff)'s [Cydia --- -## 2) Prometheus (64-bit device) - APNonce collision method (Recovery) +## 2) Prometheus (64-bit device) - ApNonce collision method (Recovery) ### Requirements - __iPhone 5s, iPad Air, iPad mini 2 on iOS 9.1 - 10.2__ - No Jailbreak required -- SHSH files with customly chosen APNonce -- The shsh file needs to have one of the APNnces, which the device generates a lot -- __collisioned APNonces available in file 'nonces.txt'__ +- SHSH files with customly chosen ApNonce +- The shsh file needs to have one of the ApNonces, which the device generates a lot +- __collisioned ApNonces available in file 'nonces.txt'__ ### Info You can downgrade if the destination iOS is compatible with the latest signed SEP. You also need to have special shsh files. If you don't know what this is, you probably can **NOT** use this method! @@ -114,15 +120,15 @@ one to speed up the process: `futurerestore -w -t t1.shsh -t t2.shsh -t t3.shsh --- -## 3) Prometheus (64-bit device) - APNonce collision method (DFU) +## 3) Prometheus (64-bit device) - ApNonce collision method (DFU) ### Requirements - __Devices for A7 chip (iPhone 5s, iPad Air, iPad mini 2) and some devices with A8 chip (iPod touch [6th gen]) on all iOS firmwares__ - No Jailbreak required -- SHSH files with customly chosen APNonce -- The shsh file needs to have one of the APNnces, which the device generates a lot +- SHSH files with customly chosen ApNonce +- The shsh file needs to have one of the ApNonces, which the device generates a lot - __[img4tool](https://github.com/s0uthwest/img4tool) can't be used for Windows [problem with signing iBSS/iBEC], now it's TO-DO__ -- __collisioned APNonces available in file 'nonces.txt' in [TSSChecker](https://github.com/s0uthwest/TSSChecker).__ +- __collisioned ApNonces available in file 'nonces.txt' in [TSSChecker](https://github.com/s0uthwest/TSSChecker).__ ### Info You can downgrade if the destination iOS is compatible with the latest signed SEP. You also need to have special shsh files. If you don't know what this is, you probably can **NOT** use this method! @@ -131,15 +137,15 @@ You can downgrade if the destination iOS is compatible with the latest signed SE 1. Connect your device in DFU mode 2. Use [irecovery](https://github.com/libimobiledevice/irecovery) for check nonce booted with DFU 3. Extract iBSS/iBEC from target firmware for downgrade (unsigned) -4. Check DFU APNonces with [irecovery](https://github.com/libimobiledevice/irecovery) with DFU booting. - You can't automatically collision DFU APNonces. +4. Check DFU ApNonces with [irecovery](https://github.com/libimobiledevice/irecovery) with DFU booting. + You can't automatically collision DFU ApNonces. - __If APNonce is not collisioned, "use hands" for DFU booting.__ + __If ApNonce is not collisioned, "use hands" for DFU booting.__ - __If APNonce is successfully coliisioned, use this SHSH2 for sign iBSS/iBEC.__ -5. Use [img4tool](https://github.com/s0uthwest/img4tool) for sign iBSS: + __If ApNonce is successfully coliisioned, use this SHSH2 for sign iBSS/iBEC.__ +5. Use [img4tool](https://github.com/s0uthwest/img4tool/releases) for sign iBSS: `img4tool -s ticket.shsh -c iBSS.signed -p ` -6. Use [img4tool](https://github.com/s0uthwest/img4tool) for sign iBEC: +6. Use [img4tool](https://github.com/s0uthwest/img4tool/releases) for sign iBEC: `img4tool -s ticket.shsh -c iBEC.signed -p ` 7. So, after signing we can boot into Recovery with [irecovery](https://github.com/libimobiledevice/irecovery): @@ -180,7 +186,7 @@ If you have a jailbroken 32-bit device you can downgrade to any iOS you have blo ## 5) iOS 9 Re-restore bug (found by [@alitek123](https://twitter.com/alitek123), 32-bit devices only): ### Requirements - No Jailbreak required -- __SHSH files without a APNonce (noNonce APTickets)__ +- __SHSH files without a ApNonce (noNonce APTickets)__ ### Info If you have shsh files for iOS9 which do not contain an APNonce, you can restore to that firmware. @@ -188,3 +194,10 @@ If you have shsh files for iOS9 which do not contain an APNonce, you can restore ### How to use 1. Connect your device in DFU mode 2. On the computer run `futurerestore -t ticket.shsh --latest-baseband ios9.ipsw` + +## Credits +Creator of [original project](https://github.com/tihmstar/futurerestore) - [tihmstar](https://github.com/tihmstar). + + +ReadMe updated on: + 2019-01-06 diff --git a/futurerestore.xcodeproj/project.pbxproj b/futurerestore.xcodeproj/project.pbxproj index 21417fc36..7f143681b 100644 --- a/futurerestore.xcodeproj/project.pbxproj +++ b/futurerestore.xcodeproj/project.pbxproj @@ -23,6 +23,9 @@ 56520BFA21B1BB14005BD3F7 /* jssy.c in Sources */ = {isa = PBXBuildFile; fileRef = 56520BF221B1BB13005BD3F7 /* jssy.c */; }; 56520BFB21B1BB14005BD3F7 /* cmain.c in Sources */ = {isa = PBXBuildFile; fileRef = 56520BF321B1BB13005BD3F7 /* cmain.c */; }; 56520BFC21B1BB14005BD3F7 /* jssy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 56520BF621B1BB13005BD3F7 /* jssy.cpp */; }; + 56DA634021E3462300821A21 /* ptr_smart.hpp in Sources */ = {isa = PBXBuildFile; fileRef = 56520BF721B1BB13005BD3F7 /* ptr_smart.hpp */; }; + 56DA634121E3462600821A21 /* jssy.hpp in Sources */ = {isa = PBXBuildFile; fileRef = 56520BF421B1BB13005BD3F7 /* jssy.hpp */; }; + 56DA634221E3463900821A21 /* helper.h in Sources */ = {isa = PBXBuildFile; fileRef = 56520BF521B1BB13005BD3F7 /* helper.h */; }; 56EF4C0921B1A8570056D405 /* libipatcher.0.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 56EF4C0821B1A8570056D405 /* libipatcher.0.dylib */; }; 56EF4C0D21B1A8750056D405 /* libusbmuxd.4.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 56EF4C0C21B1A8750056D405 /* libusbmuxd.4.dylib */; }; 56EF4C0F21B1A8850056D405 /* libfragmentzip.0.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 56EF4C0E21B1A8850056D405 /* libfragmentzip.0.dylib */; }; @@ -402,13 +405,16 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 56DA634021E3462300821A21 /* ptr_smart.hpp in Sources */, 56520BFB21B1BB14005BD3F7 /* cmain.c in Sources */, 8799B0C11D89DB38002F4D5F /* fls.c in Sources */, 8799B0B41D89DAF6002F4D5F /* tss.c in Sources */, 8799B0C01D89DB38002F4D5F /* fdr.c in Sources */, 8799B0BC1D89DB27002F4D5F /* ipsw.c in Sources */, + 56DA634221E3463900821A21 /* helper.h in Sources */, 8799B0CC1D89F7B9002F4D5F /* download.c in Sources */, 8799B0B91D89DB0D002F4D5F /* img3.c in Sources */, + 56DA634121E3462600821A21 /* jssy.hpp in Sources */, 8799B0B51D89DAFF002F4D5F /* common.c in Sources */, 8799B0C41D89DB55002F4D5F /* mbn.c in Sources */, 8799B0B81D89DAFF002F4D5F /* recovery.c in Sources */, diff --git a/futurerestore.xcodeproj/project.xcworkspace/xcuserdata/s0uthwest.xcuserdatad/UserInterfaceState.xcuserstate b/futurerestore.xcodeproj/project.xcworkspace/xcuserdata/s0uthwest.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000000000000000000000000000000000000..11c152339f7007e6f602c85f7c44f54e6b570e43 GIT binary patch literal 10027 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 S=CjZ#6JE@C@iY8xKlXosk8G#_ literal 0 HcmV?d00001 diff --git a/futurerestore/futurerestore.hpp b/futurerestore/futurerestore.hpp index f9f8b3689..bb267a327 100644 --- a/futurerestore/futurerestore.hpp +++ b/futurerestore/futurerestore.hpp @@ -71,7 +71,6 @@ class futurerestore { //methods void enterPwnRecovery(plist_t build_identity, std::string bootargs = ""); - public: futurerestore(bool isUpdateInstall = false, bool isPwnDfu = false); bool init(); From 104f50a19998d1a7cff8d182cd69616e5c7d05dd Mon Sep 17 00:00:00 2001 From: s0uthwest Date: Mon, 7 Jan 2019 00:49:36 -0800 Subject: [PATCH 17/69] Warning: jailbroken firmware updating --- ReadMe.md | 1 + futurerestore/main.cpp | 9 ++++----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ReadMe.md b/ReadMe.md index ed399d5ab..e3f682205 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -13,6 +13,7 @@ __Windows version is supported, but I will not compile it.__ * Re-restoring 32-bit devices to iOS 9 with @alitek123's no-nonce method (alternative — [idevicererestore](https://github.com/s0uthwest/idevicererestore)). * Allows restoring any non-matching signed iOS/SEP/Baseband. +__NOT recommended 'u' parameter, if you update from jailbroken firmware!__ # Dependencies * ## Runtime * On macOS, futurerestore requires no runtime dependencies, the following are only for compiling. diff --git a/futurerestore/main.cpp b/futurerestore/main.cpp index 750cd6099..4d8f72f01 100644 --- a/futurerestore/main.cpp +++ b/futurerestore/main.cpp @@ -64,6 +64,7 @@ void cmd_help(){ printf("Options:\n\n"); printf(" -t, --apticket PATH\t\tAPTicket used for restoring\n"); printf(" -u, --update\t\t\tUpdate instead of erase install (requires appropriate APTicket)\n"); + printf(" \t\t\tNOT recommended this parameter, if you update from jailbroken firmware\n"); printf(" -w, --wait\t\t\tKeep rebooting until ApNonce matches APTicket (ApNonce collision, unreliable)\n"); printf(" -d, --debug\t\t\tVerbose debug output (useful for error logs)\n"); printf(" --latest-sep\t\tUse latest signed sep instead of manually specifying one (may cause bad restore)\n"); @@ -72,7 +73,7 @@ void cmd_help(){ printf(" \t\tWARNING: only use this for device without a baseband (eg. iPod touch or some Wi-Fi only iPads)\n"); printf(" --exit-recovery\t\tExit recovery mode and quit\n"); #ifdef HAVE_LIBIPATCHER - printf(" --use-pwndfu\t\tuse this for restoring devices with odysseus method. Device needs to be in kDFU mode already\n"); + printf(" --use-pwndfu\t\tuse this for restoring devices with Odysseus method. Device needs to be in kDFU mode already\n"); printf(" --just-boot=\"-v\"\t\tuse this to tethered boot the device from kDFU mode. You can optionally set boot-args\n"); #endif printf("\nTo extract baseband/SEP automatically from IPSW:\n\n"); @@ -131,7 +132,6 @@ int main(int argc, const char * argv[]) { return -1; } - while ((opt = getopt_long(argc, (char* const *)argv, "t:i:b:p:s:m:wud0123", longopts, &optindex)) > 0) { switch (opt) { case 't': // long option: "apticket"; can be called as short option @@ -192,8 +192,8 @@ int main(int argc, const char * argv[]) { argv += optind; ipsw = argv[0]; - }else if (argc == optind && flags & FLAG_WAIT) { - info("User requested to only wait for APNonce to match, but not actually restoring\n"); + } else if (argc == optind && flags & FLAG_WAIT) { + info("User requested to only wait for ApNonce to match, but not actually restoring\n"); } else if (exitRecovery) { info("Exiting recovery mode\n"); } else { @@ -319,7 +319,6 @@ int main(int argc, const char * argv[]) { } cout << "Done: restoring "<< (!res ? "succeeded" : "failed")<<"." <basebandBuildIdentity = getBuildidentityWithBoardconfig(_basebandbuildmanifest, client->device->hardware_model, _isUpdateInstall))){ if (!(client->basebandBuildIdentity = getBuildidentityWithBoardconfig(_basebandbuildmanifest, client->device->hardware_model, !_isUpdateInstall))) { @@ -777,7 +773,6 @@ int futurerestore::doRestore(const char *ipsw){ enterPwnRecovery(build_identity); } - // Get filesystem name from build identity char* fsname = NULL; if (build_identity_get_component_path(build_identity, "OS", &fsname) < 0) { @@ -898,8 +893,6 @@ int futurerestore::doRestore(const char *ipsw){ } } - - if (_enterPwnRecoveryRequested){ //if pwnrecovery send all components decrypted, unless we're dealing with iOS 10 if (strncmp(client->version, "10.", 3)) client->recovery_custom_component_function = get_custom_component; @@ -914,7 +907,6 @@ int futurerestore::doRestore(const char *ipsw){ /* FIXME: Probably better to detect if the device is back then */ sleep(7); } - for (int i=0;getDeviceMode(true) != MODE_RECOVERY && i<40; i++) putchar('.'),usleep(USEC_PER_SEC*0.5); putchar('\n'); @@ -945,18 +937,15 @@ int futurerestore::doRestore(const char *ipsw){ recovery_client_free(client); } - if (_client->image4supported && get_tss_response(client, sep_build_identity, &client->septss) < 0) { reterror(-11,"ERROR: Unable to get SHSH blobs for SEP\n"); } - if (_client->image4supported && (!_client->sepfwdatasize || !_client->sepfwdata)) reterror(-55, "SEP not loaded, refusing to continue"); - if (client->mode->index == MODE_RESTORE) { info("About to restore device... \n"); canExitRecovery = false; @@ -968,7 +957,6 @@ int futurerestore::doRestore(const char *ipsw){ info("Cleaning up...\n"); - error: safeFree(client->sepfwdata); safePlistFree(buildmanifest); From 542cfbb89740247374e27c79242a067e95e670d6 Mon Sep 17 00:00:00 2001 From: s0uthwest Date: Fri, 11 Jan 2019 02:43:56 -0800 Subject: [PATCH 19/69] TSSChecker: added bbgcids for A12 devices --- external/img4tool | 2 +- external/tsschecker | 2 +- futurerestore.xcodeproj/project.pbxproj | 10 ++++------ .../UserInterfaceState.xcuserstate | Bin 10027 -> 15250 bytes 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/external/img4tool b/external/img4tool index 01efac750..a2a38d0d7 160000 --- a/external/img4tool +++ b/external/img4tool @@ -1 +1 @@ -Subproject commit 01efac7502d2b49d994bc84612d553cb247c53fd +Subproject commit a2a38d0d76c002af61d1be74468c6be07b6ffc36 diff --git a/external/tsschecker b/external/tsschecker index 0d4ce8209..16f471754 160000 --- a/external/tsschecker +++ b/external/tsschecker @@ -1 +1 @@ -Subproject commit 0d4ce82094bd26166319983cbbfce1e5d2ff2f81 +Subproject commit 16f471754f7272bf2144d27193f6a3312c18ad56 diff --git a/futurerestore.xcodeproj/project.pbxproj b/futurerestore.xcodeproj/project.pbxproj index 7f143681b..7de174c21 100644 --- a/futurerestore.xcodeproj/project.pbxproj +++ b/futurerestore.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 46; + objectVersion = 47; objects = { /* Begin PBXBuildFile section */ @@ -11,7 +11,6 @@ 5604B7BB219B35F8004C22EE /* libirecovery.2.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 5604B7BA219B35F8004C22EE /* libirecovery.2.dylib */; }; 5604B7BD219B3602004C22EE /* liblzfse.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 5604B7BC219B3602004C22EE /* liblzfse.dylib */; }; 5604B7BF219B3611004C22EE /* libzip.5.0.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 5604B7BE219B3610004C22EE /* libzip.5.0.dylib */; }; - 5604B7C1219B3619004C22EE /* libz.1.2.11.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 5604B7C0219B3619004C22EE /* libz.1.2.11.dylib */; }; 5604B7C3219B3626004C22EE /* libplist.3.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 5604B7C2219B3626004C22EE /* libplist.3.dylib */; }; 5604B7C5219B362E004C22EE /* libimobiledevice.6.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 5604B7C4219B362E004C22EE /* libimobiledevice.6.dylib */; }; 5604B7C7219B3630004C22EE /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 5604B7C6219B3630004C22EE /* libz.tbd */; }; @@ -73,11 +72,11 @@ 5604B7BA219B35F8004C22EE /* libirecovery.2.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libirecovery.2.dylib; path = ../../../../../usr/local/lib/libirecovery.2.dylib; sourceTree = ""; }; 5604B7BC219B3602004C22EE /* liblzfse.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = liblzfse.dylib; path = ../../../../../usr/local/lib/liblzfse.dylib; sourceTree = ""; }; 5604B7BE219B3610004C22EE /* libzip.5.0.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libzip.5.0.dylib; path = ../../../../../usr/local/lib/libzip.5.0.dylib; sourceTree = ""; }; - 5604B7C0219B3619004C22EE /* libz.1.2.11.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.1.2.11.dylib; path = ../../../../../usr/local/lib/libz.1.2.11.dylib; sourceTree = ""; }; 5604B7C2219B3626004C22EE /* libplist.3.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libplist.3.dylib; path = ../../../../../usr/local/lib/libplist.3.dylib; sourceTree = ""; }; 5604B7C4219B362E004C22EE /* libimobiledevice.6.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libimobiledevice.6.dylib; path = ../../../../../usr/local/lib/libimobiledevice.6.dylib; sourceTree = ""; }; 5604B7C6219B3630004C22EE /* libz.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = usr/lib/libz.tbd; sourceTree = SDKROOT; }; 5604B7C8219B3632004C22EE /* libcurl.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libcurl.tbd; path = usr/lib/libcurl.tbd; sourceTree = SDKROOT; }; + 56163B0B21E514B00069A0B0 /* debug.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = debug.h; sourceTree = ""; }; 563DA64221BBE40700844624 /* all.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = all.h; sourceTree = ""; }; 563DA64321BBE41C00844624 /* all.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = all.h; path = external/tsschecker/tsschecker/all.h; sourceTree = SOURCE_ROOT; }; 563DA64421BBE44900844624 /* libcrypto.3.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libcrypto.3.dylib; path = ../../../../../usr/local/lib/libcrypto.3.dylib; sourceTree = ""; }; @@ -162,7 +161,6 @@ 5604B7C3219B3626004C22EE /* libplist.3.dylib in Frameworks */, 5604B7C7219B3630004C22EE /* libz.tbd in Frameworks */, 5604B7BB219B35F8004C22EE /* libirecovery.2.dylib in Frameworks */, - 5604B7C1219B3619004C22EE /* libz.1.2.11.dylib in Frameworks */, 563DA64521BBE44900844624 /* libcrypto.3.dylib in Frameworks */, 5604B7BF219B3611004C22EE /* libzip.5.0.dylib in Frameworks */, 5604B7C9219B3632004C22EE /* libcurl.tbd in Frameworks */, @@ -296,6 +294,7 @@ isa = PBXGroup; children = ( 563DA64221BBE40700844624 /* all.h */, + 56163B0B21E514B00069A0B0 /* debug.h */, 878587991D89D2BA008689F0 /* download.h */, 878587981D89D2BA008689F0 /* download.c */, 878587A01D89D2BA008689F0 /* tsschecker.h */, @@ -311,7 +310,6 @@ 5604B7C8219B3632004C22EE /* libcurl.tbd */, 5604B7C6219B3630004C22EE /* libz.tbd */, 5604B7BA219B35F8004C22EE /* libirecovery.2.dylib */, - 5604B7C0219B3619004C22EE /* libz.1.2.11.dylib */, 5604B7B8219B35EE004C22EE /* libpartialzip-1.0.0.dylib */, 5604B7C4219B362E004C22EE /* libimobiledevice.6.dylib */, 5604B7BC219B3602004C22EE /* liblzfse.dylib */, @@ -364,7 +362,7 @@ }; }; buildConfigurationList = 8785873E1D89CFDC008689F0 /* Build configuration list for PBXProject "futurerestore" */; - compatibilityVersion = "Xcode 3.2"; + compatibilityVersion = "Xcode 6.3"; developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( diff --git a/futurerestore.xcodeproj/project.xcworkspace/xcuserdata/s0uthwest.xcuserdatad/UserInterfaceState.xcuserstate b/futurerestore.xcodeproj/project.xcworkspace/xcuserdata/s0uthwest.xcuserdatad/UserInterfaceState.xcuserstate index 11c152339f7007e6f602c85f7c44f54e6b570e43..b03b2ee2100d32a89d662f4ac901af1777a4277e 100644 GIT binary patch literal 15250 zcmd^mcXU%n*7%g?BH5CjB+Es`6xqg2(vz@_O)sVxuqnoLFtQ~Zfh`$Hri3;kAqgS9 zmra5Vgfv2W2#^A#C!0p4D-nn($ z(AMG$g(c|?gb_g$2`B+23Ks|$&dyox4TgLH|LmMV!xC>}I5a269c*0egU2&+!htp& z!sl<&dy~0oDk>lida)Kt&WU8PlYM^~+E-j!o zYNrl5ke1V-bR?~$6X;~Rh`MP5ZKNLRrA@S%E~Y^mqG8%jBXlD@pI$^a)63}P^lEwy z?Vz1>E8Rx7)7$6{`Vf7XK0Cr^f>)P5QGFlC8!0BU=XqdqmU;I5b}irp-`|3r9zo7To@sY6vhaZ!bD+` zFj-h6xP=CxQSb;}p-E^K77IRMiLg{?5n6?1!U|!vu&yr0-`>)42q};frJz)#LAqHr zwf3dnRiU}?-lgv|a~fORp-?AMAvGh6b|MjJnZSNz)%9Y|z%u7JX_RxUZA?ko7+Z-; zs<2gzE0t^&W#tv4ot1-}u9C`nF|Dd{?5sd=X{gQJ=&cMiwzqoy;TYj`l#TLspbV6W zvXBv(kQrH60!w5`ESV{olBMiGeNbQ25A_F-9Mq4cG8HRkKLAKNyxSIX>^{FIuwq=$ z-Ri9uhxaBo!`(0@;134_EiK+)eYrHQTyjb!wz5$rqiiLkDqyLSYm9A_YhY=mv%*;s^q8pB{Xx;YWQG%>4(Y9P?k;0{*BsMd>_J!8=o^&VQi+UYDQ?pt2E zwz%(VXNe>g_pK#IaDoJWicZ&F*CEU>>X$ZszWo;EHoRZJ>urIpcs<=iXP;9Q3blJf z^`iMKI4ivk?alR~=`6!DK$YsnzGoS&4F}sB!|g%Pd8r$uHqahy^mgfdT~)93bAE&F zjtR5@17rO1pcc+AFKR-~Xfg7kC1@$@%lfhY%*t|DE`z}wcm?2h84AMjONZA0_$^?C z{P@+2R^XJ(n{I}1o#+DCw-wmd@64#j zaFgT>$%u`;U|PLX-Qln|=m*xoR?m!}OM3ERfJja+1YK&(*Uwq#_W8m8b2_g_t>jv? zZVStQ9WfL^8_>CPW#i}vvol-%=nXBbsjY4g^V2^n7<8}N3UKG4jbK@$UuW0UPKgE* zQ)Pq~qD@;^k&N&>w7HYRCd*$hMVHl!`fhBMKCm7EzdHyhFGZK5jq_`2d!GFTC5cJ= zDs(H#y9-^7u0hwL>(KS+26Q933H=S-jBa5Pb21kj$Vyl#D`SILIjdlU??PKp2N>Y3 zpaa|C^A`Br4{c#X*f7w5;h+m6;PVjpTnv9fBQknPvKr1(i@fI$H`QI1bUK_M*{+QZ z1_Qxyz7`N0h-|E%v(8g58n{&A4jMe?Cy76gil?wudew|o zZE!BM06hk5zq<_pfe6PC_l$#eJ?ok{z1<)7aX-QhGAt8()#y7c}BlHQ$a0|cH)8E2uhf{ z2f-j*5!+dmx-GVsVR#J6+m45$Yw$?)HXh9y;oNyZx4qkOB_4~%;qiC^YhpgOge_&Q zeA~BGz43TsGkkby_ly?i@0k(6ZL(NmkRja8QG{7r2VTyWac=c%4|#)AgWe`@ zFzEG+fiSr_5L`7DB=6_xc2%WpPVqTWyBI^X7O&@s*0E3rW-QDRX)9;W=nfR4QA5jf%@&`Mk-Ls)2;1!K3hdLncfuWiJ=iV3#~t+W4RT<4lc0<<<+_Uey|%rf z6`<$J-=Y&mJs*swV;6VeL+ld1nOvEAS88)MWHFJxjluJE;CI-i9rz#YGG?1m4Z&h; z^k4WxF0do`ef$BtoL#}L+=@Q}Zhpe90uDaQ1y&G8j@x%{Eo4#t=IF=n$PPkvh=t-| zyBy)E&&PWMt=@1@4ps3nw5bDs$*yKau|<7@e}+&We~Z7v-{T+fzwwXwCw2|HmR-lL zXE(4L*-bm}FZfsd8$J%N6Zj^V^Mn$V) zJa&s`K8Q>{8!*C;C%1zT48*+E8OBVpu^wyCeHiD(#_Fa|hA^`+&}w(LwY7NdE2Ak} zTQI{wvFv%_pseuDz<1I zHE^noNZultspY;vdnoQC0~W6GKaK z(7H~NOY+zbc4xPdB?ZKGs>LF9)Q?E)b}%J(a8~#0VN>^E<{HvtdaWZpi+YZ#U|8=s3#sTXzf9(%Jk>Ke#sI2mLN+r^6BAmhk*G6AKKDl(Bw zB9rHYqGt;sS_9WNFAc2#Zib>FsMC`c?JQMft6F5Vsm@O z*pqB8JHYm^C+bBbyC~6JJCSvwjqAiRwhyc&36pkM@p4o_R?h9A zQ5U7o9s~RRcs$c()~+UNth*UR4vDYQbx!I zP`UjK>iST2Amj!msK|=M|&L1A#y2j|1z?HTtO!Bf^>sB2 zc}rK5YaqjhgV{;0MjK^OUdKgwJ$sH7#l^hkW#v#9b-B8eSMoQ~0m&=5ncPBdC0p1F z>_zqx`};Q1Nw$)0WIKDA9b#{?w;&^#>}`q`BIiu^H7|~Snk$D1a;Oq5Rm6&w-N8!i zEZj}*<79S{d&n+wFMEZ(%3foyZ-cb40_tfwU=9sXNlWK8)-=-{^l={w@uqi0v>q|t zy+Y1r>qTSyXjc?a+Zf=5j=ph&(docxFh-3*UmGvkLKQa-B#NCo^4L1}k;l2se~i7+ zfhu54upTYcz(RqRuAG!_R>U#zr^qur0OGMYd6vD+^J?fLkQcZ+c#*us-eLdjaR;xE zL#G+;H^6Ye#omRT|ASR`v)DRvb>BFf|4(w{w5jjI)DPKVnED>8?hy*i731c9Mviv7 zu`k$>*c!j$Yy6sg!`^2f^{nxG^3!RAeg;CnvJZgJhd>C9f~>jLk-kN7gica&>Rd`u zKbpWk2Kj!%-5pQ6W5KH&pU;1?Hx8<#DYDIcgQ}^9iYSF@$p)&YY2eF(fk0SRIUdE< z@X%V!X!iPj?IC$dyjlr~vpka77WB13rSP;N_6?k#&)N5H(R7*t1TtwBH3AVWwU7fe z8%>xEz0DR+(CeSs=7zuFd5s*eKP*?%`g*!t;n|GFyg<+w3%h~RH|#rhw3iE@eQ7`L z0%#8Vntc(q*k47}hUUScr32WpZu?6Mx&38do^Edc%tXfRiyYhFhZ`p(qVLXy*K~_)a@SPS`zV$@1!HRVf?G$QA0&X(b00D{6A6Xq+>XC zUQ_>1ps&-hu$OUkJhze_2+OBvg_{~;t!zxFkdQch#9wS-i-x3Rg)${or8cCSa|(-! z9i?T11`m^)giyVQ9#dbZYhYjAVB%)9uLLh=g$w>jrGxs`LEmd|Ip}0uw9^ycfC~5C zk=!erDpz@9et@g6+^0LF5w$vfT37FJ_KIkCuZnjP+q!eS9?#4aqK_rdVxFU*&bkpSyaZed5P@qliMt%|O`8*}93~ zK6tsj<-mZDUvIKnaXuP3G`R()6gANBPJ_NW^`K;=g)X=i*`QrJ2pX7ma4BRhv}ySDkEhW~ zaJAzw)S`bxKcipaN=E_~aTXqohe1WM8rR`Pa9zWLo8ZdE61)rwTpe&ZV>{jf7cu?` zrHF4J@Bft;$RJWdhLB-!m0}rLPBxMY;mX8~5C`2&9w$f0SL8>y0Fg$`)Jlu#2s()_ zq)RA+D-Bn}MTYHgiQx`HYLUxYDp2t~2b5dNa7(A-}`rmbf4K1pBva z3#;fv5Mx)9jF%I((keO$Z3OY~Z(RWft)@`Wyq(t2DRe5GMyJzSI)m1+pV-gr7xpXr zjU8vdvlF+Y96FoMp>ydxI-f3}3&B^PjNma5JT8J~L~vaM&x+vLJeo-x4JD+dZ2_M@ z9E!H$q2vOMCSzCmNOqRddPZnmAP7NaXujOBm)jPAK>i9X6o{*!O%lz$L5X7qOjZVn zw2bm6-tqG{L&w7}m#}yS4&bpYz8gGKuHefHh#}+jW32GeR+P6Dq_C8>usxT`<&VZj>jEMgQ9JowpB5D|NDqNRyB!r%uk^;)!Xb2wTEIW z^27p8x}2_tz?iO}E9okFP6X2kPKe;72v%&PYv@|Kj;@d3lnB;EurY%BGh46JfSw2b z{Fw+A>cw|f+E#K)Zd)Puw;>*0^*>L{M?f|kTVm7=O^2cnFGYjh7}hYb)HBcvmsv_Z z?vjd%Qb}@^dj^#bY;ZPs8cL+5MsKOd<@A*1or+|JySc|taZJlAq%#3cX^R#rIfRrK zhM;^{*xlTFyPM?gCf17!{wv#c#F{J)p9ePD*xk(O$-d~NGR@?A@zwtd&C^&s8jeTf z;&=wNx}ky_JdH;(XfHOEoCRdMw>1!sc3U_zAslV?`DKmjOK;-peI31?-av1R;M53KMX)-8HQS(zUO{i6w?g0C5W!*uYx(JQLWC5jf^}8g zv2>l&F7p(tPerQ=Q0@2&b7ZeGrD;0!#s4CeMjnSv4TRvXO#s{^k9E(!GBDa*8KO02 z@oU}PH_Pbl^d9J?bvcc@>COn&M{rsM!_LzqIAc574sPTYa3sKv2+oZ1BkTWrmX!V} zOJrfmp+#UtkB0wsR%!_-Wd0zx*Hz*5Hh7zyWhD)6xG>;uXe_Dly31UWw+YNqX@#e} ztg$?%bC1!3oY#-jC+L%OKRpn^rU*7iuqA@CBe)Oe_0z!XXJuaZjq4Fs&JK+RFsxVB{5dNPT%3IK1AQ3Z_>Bu z+YxMy;G77~jo`cp9uQ;o;ohvy|3A;_{{^EzrJwUc(@FMp2R$0Wg%AhGcUI|_^m`D& z8T&i*2co4v(w_(znj*F>f{P>A1}z>ivuCT2pS@#1f9Lgr6A^6h)iMx}fT21&IfA7K zcJQWvT*JpjKX$E8NE8&kYxsgvfM~`U!LC#9M4Ww5F;t?U111RC2rlUmzR+R*%vsBWA-81*>O;M*Q(Y6^Mba#+7Vg=>c~DG04Tgt; z;{q)naGTL$k5B}{6F~e!d9??sKY{~o+Qxg^`~~GD`Bh|n;#=8!#r8Z%7>snCLb(9j z1jjV8Qy3x)jo?ucxDHZX*90U&3q4)+u*qJ3b9k|gepK{IpO&P>5RDba!$k=J@{!68 zVL}9tmHYiX#gyv=@ul!GNSHf+t4sqzDED ztd8KC+l5*D)|D_|ithrlk(D7|+hX8SK^y}h4 zC_Hmzd0Bl~$<#SBt5-nDa!|2T7K0zH>p&{FvL3tmAq0gmoFV?KLuilSnO)^zVP!X@ zJabLgB~Pv^>(Qp$@JV_OWGE}?3PH=BhV&$wq(G_y2}=p@GMrk)cum+OTvQiTW`-f7 z&w{J#MW_@FMkC0NY^pI406{n{QJP=^h(IHuZ5uTM*25! z)jR1fdLMlN{&CikG9+arWhI%C zEJ?*l_9Q9El~j^cmQT%J58d2;f+Px3>_2a-QY{$8O_q$pGhjY6x?D-4PZMV7*(uqgT{ z$`s{_!HS`Z;fj%p(TYmNIK>3TM8#x9jbgE4h2l!Zor>ob?#apjZB1IqW5zocZQ7*m`n z!&AnmRHaNxsZN=aGCO5%%KVgtDT`7XQr4y1nsQ&t<0<=74yHVl@?6RbDTh;zrhJid zEaj_|pHhye>Qeip7N^=%rBqjHNorYYdFt5I@u^j*lTxcwr=(6xtxa8$dPC~&)WfOA zQctLqDwRs3(y7u^=_;!#PnEAKQrT1v)iBjW)fCkMqqz)h^XO)nls1RZptkR(-7cOm$TCrRrt{$u&svfQ$sUEGKqYkULs_#`lpngcbTfIlUPyM|5 zCH2ed*VKp9Z>m31|E4~!N!FxjR2osE)1+zoX>v4qngUIc#-PG7- zbyd2Vx&^v=om2WGfXf{G|VzAG%PYS z7(9lhhE_wsu*?uLTxZx~*lBps@UUUGVUJej6lYQj4Lv>WjvX2AmgcwXEL74cp>BW%!JJ3Ol4+jW>#iSW?^P= zrae>29G*Eovng|F=0%xTWp2sr%-oiFTjs9Jr!!y3d_VJOR$5k8R%O=otc$a5$m+=2 znYAnHzN`nb_GKN&dN%9TtV3CEX1$&Db=GmCU`#Y783!3OrcX?tnU0#iH~nn-)pXo+!mKoF&3d!JoMFy3_cix7 z=a}=%lDWb>&RlJtVxDHMHP1EAH!n0VGB=pR=C$UF%$v;@n=durYJSlCviYd_nE5O7 zH|FmwN{ilNwB%W;EOnMymN}MrmIaoeC2U!4S!p@Pvc|H}a-roS%f*%(EH_zhw%lsj zX?fUk(DJn9SCKDB&q`NHypYRGAF@7Tebl#Np7*0-$hS`S-~SUvOi}+?{hz&V4x#=IqURJZFE-Q#sG%3c15`{kf}i&&$0a z_oCcOaxc%lA@^^&x8`={ZqMD3`(WD&i|qyyI?}Ww1T>VhJx0D zwt`T>@`6+F!DR(k7F<(sUBQb5CkmZ~zQU^tuPxkP_;TU9g@+4|6nHoSBqSZQb)OCh@;Xm-Z9ZJ*)hd2&Ea=k?bz*j z+ws2RBgdzX&mG@6eslcpI4L2CNP?u2j8Y$|zmzK#N;V0~l+ZUCFHM!ENwv~UsZnZ@ zd{T=Pkd{g7rAwq6rMskir2C`?rAMSa(qqz-(n0AB>22v<>7UZSqz|NzrO%|J(lO~r zCvs*vCFfY@TxZa^*?FCFpYx#eDd)@1x1IlR9(MlAdCd8>^IPW+&YzsWxUfrbCAyMb uT9?k1=CZg7UBxbk%jGI{mAi(xhPkG=X1M0cp*A7%yRbP{IFjF8^Zy^*swcw$ delta 5558 zcmaJ^34Bb~_doZ(+1EGk&AbVnc{7oS)Sjl6AVtLzVvs}-Ax1I?StOY>Vw+>BqFT$N zsZz4pYTv7>=)P(#)heo0RYeyq-F{mCJBiTW-{=3I_eti>z31F>?)QGra+j5F_APO! zxM;4qa!!sV-!JXeCNvtdVGQ_TEaX5g1YjJDha#8;Pr^J{2uolpEQRM`6|9CDsD%x% z8Fs)Pco|-W*WnF#58j7U@F|>z&)_Wl06)S{@H5_$x|3d{FBwRDB!dhi!^sGeNwP@}$s+}% zn3RxGQck9j3KAl-$vpBDQOI(#f;>kmNiC@(>&SYtfxJX^key^7IYN$-*U5+EBbY*t zkyGSTa+Z8Wu99oyI{A(KPW~XF+f+r>R717YNh4?z+LS&-UDQpZXf$m}ThVy>DD6NK z>0`7z?M(;JA#^AmNwa7+4bVxnj6Olj=`1>%&Y{oHXX#?9&`P?QZlPQ0HoBeepgZX< zx|<%Luh1j(6MCGUpr`3sdX8SA-_pzUdMy2c{>V{|<5ZlQ({Nf&$LTo(XXH$rnX_A4IKCHa&?9>OI zf(6wuAEPn$Bs>j^n94J31B)}0a|4CJym5JflA+0kxq&IzoT1fX)VQ)>SxKNIP|5%c zoPcGZz;aljeBzOmf(W;|2A+dTWm1G^$Z%iUps^DJIl%^@mGHtaUs}(S5`RSvtb|H2 zbf@8S5?*9B*T7n+g8Y%WMLA^!%<$0Elo7$a0%pcvFd186YXl`u8lrDltPa*G+asJR zSkH`YkC5&TZ-h(f740a8lRs%uL!6k^<0O#RLxBy?l*KiTO!ETs{k70N0fj#l@4e%{o zhVS4Cd#=JY?1f2~hehm}jK$2m7UK3U@EiOM!g}}}{(wK>FZd7K#@^Tm`(i&##{TQ! zAGkw+5JCxu126?g;b_dp3Cu5@eUb8py{)p`-mXQ=@SLLDK>Xm6qVUN#gjIIKSh~Mt zeBkbof^8#nh?!U!AjE254Aw{Wm~rG^%O#L5qkU-u z%Yy!~`GIVmDbkO{4T~Oy;8sw81 zu$ES0kCY#PxgGo?OF z4`g&6k(xJtLj6o5h|iN3!)vZ2FOXGaHBQ6nI0I+aK_ql1RS?a{7lR?jl`Lgm)ACS* zUmIaT)xD@Co5|KN_qX7zYO)Py|9{-y73ThKvIpnjy!+hWPYymn(pMQtU&Fb~@ROKv zZ#$1f^_b?ZCu^hoZ;*E$(0!NbzK>5a-T5qT4n5Q~L_Q|R!#;k3Pgg^Cwxe)-_9`kY zEy@q{$;%H0O2XhYu6de#elM8M;4_VEJr{QVJoyrz#ijS1|C)UJfCHDA16Ob{b6^Q( zj7UyOxLcK@dgP7yFYkXKHy%*_g+={MT*iP`nD=8{&AO96$zKh0ZS?SO3Ss8|L+;>n zSXn~}rT9Fqtlw5zec%Lgef}r%#`{@mQ(n|GSJrAGhu_tvI?9sOda9=eYNRG=rWSkw zSK(@W5!c|_^^~VJDnKN)v#MW(oA4#(%NF*>K(mKCj46}-tcvE==d}9Tf6f%CyljeA zCYpRnjYeeZ1)-XHu)3N?Vhv_w^H!#u;motltr!5%XGzM#{X)M+;sVAJ?P{2Jn4m-F{9CLAKLGp-LPs_<3tMe-P0I^TkmV6Qr1C*^H-x}1|1$=Vi<0( zrXz3%bA7V)VLu&3oK^QILdVdtOsGCUXb$eW%O^UHIBV&6I)UclZrq0l?knWe$^V-c zv>2jkDehsM+RJFsjgM+Zr_kvSh|OSPA>7ZzUS?vmc)1y!OXoizwt$H}jju4VgG}rw z?{b`=OTb8%(q-X9mFo}s2ia6>ln>-gb!Tr}`vj$>r_wwbbtAHUX~XggbBoG%f8a^F z+llVBM+R9nJ*zBi)+WTU{$C_6l1O^6WImX+^f@Fz#i1QG6ZWz&G(Ne0w89 zv6j}+b#y)5KsVA&49|D)B%a1g_$_{iSL#FN@sfaYHEORw_t1S|vh2lotLc7xkC8>y zyh~=I$%FI|n`J#saW#Dn-@nhXqx4-CuK#B{L*Iit^aIw-e8k$B4_G_%A!}zoV(m;8 zYfYLe>b6aN^du`J^b{WZSD~e!(a*z$7C*s{|5aXts~Y_|Prv$ib){d^i+CJQuw@TQ zv5gHP{f>Sg4wWl-s+wNKPZ^nt+eh`MKhZxx*vL-p2K|NpN^jCz^f&rDeukgp8T5G7!S>Vk}EVzO(^>ia>79lAH;w5SJWhv}!Rl zE$9yhkbn-FKr?6s9iR(zr}hxLCAOgL7(;tfmNRI7I*8p1)7Z^$I=lac8M>3*`S#NN z?B2&tk$y;zvAf?1dWzlsKBr%>+ut>=H8+$)u7-P!JHy>n5f!fzRCbl5icmFGxm2>M zjjEk0P8F}}pz5SbP<2%$ss^Y=tBO@~Rl8N8w^bKZ*Hw4aM9rzyYOPwYHmc2PtJ!Dg)h*Sn)os=7)sLtjRd-Z(R`*h8sVAyusTZkh)ce$D)YsL2YXnVeO+x8xjpY z438Un8~PfO4aJ6;hFONt9K$@re8WP+V#8`ftzn&EgJF|lhhdjtk71wTWy2-IZKK`j zHhPWCjM2t8V-Mrw#w24OV?SemV~Wvd9A(Tl`i(ipfN{Jr&p63gV4P~4XRJ2vH6Azq zWc-iGVQOY-XNoh$n>v^}nG#H0P5n&$O(`ayX|O5Ply1rhndX^xn!Yky%!%f4W;8!z zUSeKmUSX~@uQYEp?=v4XA2J^{A2lB{e`@~Be8zm%e9?T#eA#@(eAWDiMQw?&bh9K{ z`d9{8vMhc}p{2}HZmF4wal~3w=A?gZCPYlVOe9@YT08sWI1X1!t#^lw&icj zKUT2nts#@uV&$!o)>hUw)^^r7YrM6aHQDO34z{LRhgnBhM_NZ&1J-=&RO@oUa%eUm?`Hp;Nz6;-%Pv!^k1No7BE?>--@@0HE|0I8y z|Bye$f5l(qFY%Z8pZHt+UpCIB3E6ZugDuk5*4D|EVC!m2v~{=jv-P*7*nGCZwp80l zTd8fPZN6=VZH=wUR%5HPt+#Er?X>N-?X~T<9k6|7yD2z@_CkWtMd&6Z3n_w67$T$z zLxnt{L?{<3glWPIVWF^8P=pmirLab*5^97xVZE?jcv*N$2z@9V6Fw162xo+|!g=9> z@U?JFxG54*C2B;yXcWz2q}W!B6XV5>VrQ|7*h}mu_7_t`pEyz+E9Q#h#0g@NSS*%` zWn#HFOI#>cifhCwu|}*DH;Y@v?cz>xxA>NLOgt-|6VHnm#OvY>@mKMd_?LKF{3m1w zyWQT&o@pO%589uwPq9z6Pq)vsqx~8CV*66NVqamew6CpcBDFn zI)*ti9a)aij>(Q04s^_RJn4AKvA|L3sB>&`Y<6sQ>~idJ>~p;AIN*54amsPVan^C( zanW(faoKUjaYNEc4ki?{iPIXkTgU}lg3DXX{?kh z6-z5z0-dR=-`dRzKfIxT%JeIcEbzLc&>zeqQw-=sgJ zJ5J){oNA}m+0+^3Z13#kOmKE}COVUxeVqNA{hcY!%#bt3IoVn6tZ+_q&T!6k&U4Op zE_5z(u61s7?sOh-jdYE2jdKNE(_FJ%i(OT&8dsfby=$ZECD#_$HrEc$vNr>#AGpw!2%o6Wy8aeD_oCKtM2RWpWHXx zzsewo%(7Ls$)fC#opKX7Mvj$R%B|(La(np^`BB*?=g9eTkz6d7%5&v;@_c!ryhvUl z*T@^>P4Z@WhrCPPBkz;nl)sd($v?_J%fHIEB#g=d*(ljk+hNzXN}%FBB@c)NKMy?wody=mT| z-eKNc?|5&XH{V<6o$RgfPWR6AqIZFJp?8sYh4*>y3*Ob Date: Fri, 11 Jan 2019 05:44:26 -0800 Subject: [PATCH 20/69] idevicerestore: reorganizing --- external/idevicerestore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external/idevicerestore b/external/idevicerestore index ce93d0c44..4cce137b7 160000 --- a/external/idevicerestore +++ b/external/idevicerestore @@ -1 +1 @@ -Subproject commit ce93d0c443fb8fefe4512bda738992f3b5021892 +Subproject commit 4cce137b720e0342bbeb4c165be9e2d2bd09f495 From 51d5d9555055798fb09d7bf5a0f5ebd5173ffd1c Mon Sep 17 00:00:00 2001 From: s0uthwest Date: Fri, 11 Jan 2019 05:45:52 -0800 Subject: [PATCH 21/69] Make: removed duplicated libfragmentzip dependency --- futurerestore/Makefile.am | 4 ++-- futurerestore/main.cpp | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/futurerestore/Makefile.am b/futurerestore/Makefile.am index 60359bb40..4ed2fb34d 100644 --- a/futurerestore/Makefile.am +++ b/futurerestore/Makefile.am @@ -1,5 +1,5 @@ -AM_CFLAGS = $(libplist_CFLAGS) $(libzip_CFLAGS) $(libimobiledevice_CFLAGS) $(libfragmentzip_CFLAGS) $(libirecovery_CFLAGS) $(libfragmentzip_CFLAGS) -I$(top_srcdir)/external/tsschecker/external/jssy/jssy -I$(top_srcdir)/external/tsschecker/tsschecker -I$(top_srcdir)/external/img4tool/img4tool -I$(top_srcdir)/external/idevicerestore/src -std=c++11 -AM_LDFLAGS = $(libplist_LIBS) $(libzip_LIBS) $(libimobiledevice_LIBS) $(libfragmentzip_LIBS) $(libirecovery_LIBS) $(libfragmentzip_LIBS) +AM_CFLAGS = $(libplist_CFLAGS) $(libzip_CFLAGS) $(libimobiledevice_CFLAGS) $(libirecovery_CFLAGS) $(libfragmentzip_CFLAGS) -I$(top_srcdir)/external/tsschecker/external/jssy/jssy -I$(top_srcdir)/external/tsschecker/tsschecker -I$(top_srcdir)/external/img4tool/img4tool -I$(top_srcdir)/external/idevicerestore/src -std=c++11 +AM_LDFLAGS = $(libplist_LIBS) $(libzip_LIBS) $(libimobiledevice_LIBS) $(libirecovery_LIBS) $(libfragmentzip_LIBS) if HAVE_LIBIPATCHER AM_LDFLAGS += $(libipatcher_LIBS) diff --git a/futurerestore/main.cpp b/futurerestore/main.cpp index 4d8f72f01..4914dd8a2 100644 --- a/futurerestore/main.cpp +++ b/futurerestore/main.cpp @@ -72,10 +72,12 @@ void cmd_help(){ printf(" --no-baseband\t\tSkip checks and don't flash baseband\n"); printf(" \t\tWARNING: only use this for device without a baseband (eg. iPod touch or some Wi-Fi only iPads)\n"); printf(" --exit-recovery\t\tExit recovery mode and quit\n"); + #ifdef HAVE_LIBIPATCHER printf(" --use-pwndfu\t\tuse this for restoring devices with Odysseus method. Device needs to be in kDFU mode already\n"); printf(" --just-boot=\"-v\"\t\tuse this to tethered boot the device from kDFU mode. You can optionally set boot-args\n"); #endif + printf("\nTo extract baseband/SEP automatically from IPSW:\n\n"); printf(" -i, --source-ipsw PATH\tSource IPSW to extract baseband/SEP from\n"); printf("\nTo manually specify baseband/SEP:\n\n"); From ae2740721d8420b069ea75c200a000c7f1cc747b Mon Sep 17 00:00:00 2001 From: s0uthwest Date: Fri, 11 Jan 2019 09:25:33 -0800 Subject: [PATCH 22/69] idevicerestore: detect SE chip on new iPad Pro (3rd gen) --- external/idevicerestore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external/idevicerestore b/external/idevicerestore index 4cce137b7..8a42aef21 160000 --- a/external/idevicerestore +++ b/external/idevicerestore @@ -1 +1 @@ -Subproject commit 4cce137b720e0342bbeb4c165be9e2d2bd09f495 +Subproject commit 8a42aef218572f9380bb4c4ef2c221d984172760 From 89e71782dbd312cf7bf179980afb74c62f97c7ba Mon Sep 17 00:00:00 2001 From: s0uthwest <42713499+s0uthwest@users.noreply.github.com> Date: Sun, 13 Jan 2019 09:56:36 +0300 Subject: [PATCH 23/69] Update ReadMe.md --- ReadMe.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ReadMe.md b/ReadMe.md index e3f682205..94c7d6e2b 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -3,8 +3,7 @@ _futurerestore is a hacked up idevicerestore wrapper, which allows manually spec Only use if you are sure what you're doing. --- -Latest release available [here](https://github.com/s0uthwest/futurerestore/releases) for macOS & Linux. -__Windows version is supported, but I will not compile it.__ +Latest release available [here](https://github.com/s0uthwest/futurerestore/releases) for Windows, macOS & Linux. ## Features * Supports the following downgrade methods From 0366135b66b6bf0240b6b0cbdce24e4c2e406813 Mon Sep 17 00:00:00 2001 From: s0uthwest <42713499+s0uthwest@users.noreply.github.com> Date: Sun, 13 Jan 2019 20:41:38 +0300 Subject: [PATCH 24/69] Main: fix cmd localize --- futurerestore/main.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/futurerestore/main.cpp b/futurerestore/main.cpp index 4914dd8a2..72fdb58e3 100644 --- a/futurerestore/main.cpp +++ b/futurerestore/main.cpp @@ -17,9 +17,11 @@ #include #include "futurerestore.hpp" #include "tsschecker.h" + #ifdef HAVE_LIBIPATCHER #include #endif + #ifdef WIN32 #include #ifndef ENABLE_VIRTUAL_TERMINAL_PROCESSING @@ -64,7 +66,7 @@ void cmd_help(){ printf("Options:\n\n"); printf(" -t, --apticket PATH\t\tAPTicket used for restoring\n"); printf(" -u, --update\t\t\tUpdate instead of erase install (requires appropriate APTicket)\n"); - printf(" \t\t\tNOT recommended this parameter, if you update from jailbroken firmware\n"); + printf(" \t\t\tNOT recommended to use this parameter, if you update from jailbroken firmware\n"); printf(" -w, --wait\t\t\tKeep rebooting until ApNonce matches APTicket (ApNonce collision, unreliable)\n"); printf(" -d, --debug\t\t\tVerbose debug output (useful for error logs)\n"); printf(" --latest-sep\t\tUse latest signed sep instead of manually specifying one (may cause bad restore)\n"); @@ -104,6 +106,7 @@ int main(int argc, const char * argv[]) { int err=0; int res = -1; printf("Version: " VERSION_COMMIT_SHA_FUTURERESTORE" - " VERSION_COMMIT_COUNT_FUTURERESTORE"\n"); // versioning + #ifdef HAVE_LIBIPATCHER printf("%s\n",libipatcher::version().c_str()); printf("Odysseus Support: yes\n"); From 7c174a279f98cc261936252531d1f2ab0bb4da4d Mon Sep 17 00:00:00 2001 From: s0uthwest Date: Sat, 19 Jan 2019 06:57:30 -0800 Subject: [PATCH 25/69] ReadMe: add libipatcher lib --- ReadMe.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ReadMe.md b/ReadMe.md index 94c7d6e2b..4fe4288d1 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -18,12 +18,15 @@ __NOT recommended 'u' parameter, if you update from jailbroken firmware!__ * On macOS, futurerestore requires no runtime dependencies, the following are only for compiling. * On Linux, [usbmuxd](https://github.com/libimobiledevice/usbmuxd) is required at runtime. * ## External Libs - Make sure these are installed + Required: * [libzip](https://github.com/nih-at/libzip); * [libfragmentzip](https://github.com/encounter/libfragmentzip); * [libplist](https://github.com/libimobiledevice/libplist); * [libirecovery](https://github.com/s0uthwest/libirecovery); * [libimobiledevice](https://github.com/libimobiledevice/libimobiledevice) + + Optional: + * [libipatcher](https://github.com/s0uthwest/libipatcher) * ## Submodules Make sure these projects compile on your system (install their dependencies) * [jssy](https://github.com/tihmstar/jssy); From 19e33a2916ef864c7f18cebf12d2420421463f91 Mon Sep 17 00:00:00 2001 From: s0uthwest Date: Sat, 19 Jan 2019 06:59:36 -0800 Subject: [PATCH 26/69] idevicerestore: added latest libimobiledevice changes More clearer iOS 12 / A12 devices support --- external/idevicerestore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external/idevicerestore b/external/idevicerestore index 8a42aef21..708f3d602 160000 --- a/external/idevicerestore +++ b/external/idevicerestore @@ -1 +1 @@ -Subproject commit 8a42aef218572f9380bb4c4ef2c221d984172760 +Subproject commit 708f3d6027f571e2812ff75f97fa083ad2c424c1 From dbaf69b0ca157673d52d483b7f2f246cda01bd98 Mon Sep 17 00:00:00 2001 From: s0uthwest Date: Sat, 19 Jan 2019 08:07:25 -0800 Subject: [PATCH 27/69] TSSChecker: add bbgcids for iPad Pros with Face ID --- external/tsschecker | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external/tsschecker b/external/tsschecker index 16f471754..8e942f75d 160000 --- a/external/tsschecker +++ b/external/tsschecker @@ -1 +1 @@ -Subproject commit 16f471754f7272bf2144d27193f6a3312c18ad56 +Subproject commit 8e942f75d234134344896952715438b64c498686 From 01ea27519e5a43df650db3780d2266cba8fef282 Mon Sep 17 00:00:00 2001 From: s0uthwest Date: Sat, 19 Jan 2019 08:09:58 -0800 Subject: [PATCH 28/69] Enable zlib dependency fix compiling with libfragmentzip --- configure.ac | 1 + futurerestore/Makefile.am | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 3f1261a4a..3fadf1ebb 100644 --- a/configure.ac +++ b/configure.ac @@ -34,6 +34,7 @@ PKG_CHECK_MODULES(libzip, libzip >= 0.10) PKG_CHECK_MODULES(libimobiledevice, libimobiledevice-1.0 >= 1.2.1) PKG_CHECK_MODULES(libfragmentzip, libfragmentzip >= 1.0) PKG_CHECK_MODULES(libirecovery, libirecovery >= 0.2.0) +PKG_CHECK_MODULES(zlib, zlib >= 1.2) AC_PROG_CC AC_PROG_CXX diff --git a/futurerestore/Makefile.am b/futurerestore/Makefile.am index 4ed2fb34d..3aca59b1f 100644 --- a/futurerestore/Makefile.am +++ b/futurerestore/Makefile.am @@ -1,5 +1,5 @@ -AM_CFLAGS = $(libplist_CFLAGS) $(libzip_CFLAGS) $(libimobiledevice_CFLAGS) $(libirecovery_CFLAGS) $(libfragmentzip_CFLAGS) -I$(top_srcdir)/external/tsschecker/external/jssy/jssy -I$(top_srcdir)/external/tsschecker/tsschecker -I$(top_srcdir)/external/img4tool/img4tool -I$(top_srcdir)/external/idevicerestore/src -std=c++11 -AM_LDFLAGS = $(libplist_LIBS) $(libzip_LIBS) $(libimobiledevice_LIBS) $(libirecovery_LIBS) $(libfragmentzip_LIBS) +AM_CFLAGS = $(libplist_CFLAGS) $(libzip_CFLAGS) $(libimobiledevice_CFLAGS) $(libirecovery_CFLAGS) $(zlib_CFLAGS) $(libfragmentzip_CFLAGS) -I$(top_srcdir)/external/tsschecker/external/jssy/jssy -I$(top_srcdir)/external/tsschecker/tsschecker -I$(top_srcdir)/external/img4tool/img4tool -I$(top_srcdir)/external/idevicerestore/src -std=c++11 +AM_LDFLAGS = $(libplist_LIBS) $(libzip_LIBS) $(libimobiledevice_LIBS) $(libirecovery_LIBS) $(zlib_LIBS) $(libfragmentzip_LIBS) if HAVE_LIBIPATCHER AM_LDFLAGS += $(libipatcher_LIBS) From b163093f4c675613f973a2ba2986191db1d2de99 Mon Sep 17 00:00:00 2001 From: s0uthwest Date: Sat, 19 Jan 2019 08:31:34 -0800 Subject: [PATCH 29/69] img4tool: fixes checking update blobs for A11 / A12 (X) --- ReadMe.md | 3 ++- external/img4tool | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ReadMe.md b/ReadMe.md index 4fe4288d1..924d1f96d 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -23,7 +23,8 @@ __NOT recommended 'u' parameter, if you update from jailbroken firmware!__ * [libfragmentzip](https://github.com/encounter/libfragmentzip); * [libplist](https://github.com/libimobiledevice/libplist); * [libirecovery](https://github.com/s0uthwest/libirecovery); - * [libimobiledevice](https://github.com/libimobiledevice/libimobiledevice) + * [libimobiledevice](https://github.com/libimobiledevice/libimobiledevice); + * [zlib](https://github.com/madler/zlib) Optional: * [libipatcher](https://github.com/s0uthwest/libipatcher) diff --git a/external/img4tool b/external/img4tool index a2a38d0d7..768d445ef 160000 --- a/external/img4tool +++ b/external/img4tool @@ -1 +1 @@ -Subproject commit a2a38d0d76c002af61d1be74468c6be07b6ffc36 +Subproject commit 768d445ef60c88d144f01faecbb4889344f1405d From 4db62b1f567c7d87ad3538c4e908c5469253119b Mon Sep 17 00:00:00 2001 From: s0uthwest Date: Tue, 22 Jan 2019 12:33:15 -0800 Subject: [PATCH 30/69] ReadMe: actualizing --- ReadMe.md | 141 ++++++++++++++++++++++++++---------------------------- 1 file changed, 67 insertions(+), 74 deletions(-) diff --git a/ReadMe.md b/ReadMe.md index 924d1f96d..d0deaf006 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -5,18 +5,20 @@ Only use if you are sure what you're doing. --- Latest release available [here](https://github.com/s0uthwest/futurerestore/releases) for Windows, macOS & Linux. +I'll compile only macOS & Linux version, Windows version won't be compiled. + ## Features * Supports the following downgrade methods * Prometheus 64-bit devices (generator and APNonce collision mode); * Odysseus for 32-bit devices; - * Re-restoring 32-bit devices to iOS 9 with @alitek123's no-nonce method (alternative — [idevicererestore](https://github.com/s0uthwest/idevicererestore)). + * Re-restoring 32-bit devices to iOS 9 with [alitek123](https://github.com/alitek12) no-ApNonce method (alternative — [idevicererestore](https://github.com/s0uthwest/idevicererestore)). * Allows restoring any non-matching signed iOS/SEP/Baseband. __NOT recommended 'u' parameter, if you update from jailbroken firmware!__ # Dependencies * ## Runtime - * On macOS, futurerestore requires no runtime dependencies, the following are only for compiling. - * On Linux, [usbmuxd](https://github.com/libimobiledevice/usbmuxd) is required at runtime. + * On macOS, futurerestore requires no runtime dependencies, the following are only for compiling; + * On Linux, [usbmuxd](https://github.com/libimobiledevice/usbmuxd) is required at runtime; * ## External Libs Required: * [libzip](https://github.com/nih-at/libzip); @@ -24,10 +26,10 @@ __NOT recommended 'u' parameter, if you update from jailbroken firmware!__ * [libplist](https://github.com/libimobiledevice/libplist); * [libirecovery](https://github.com/s0uthwest/libirecovery); * [libimobiledevice](https://github.com/libimobiledevice/libimobiledevice); - * [zlib](https://github.com/madler/zlib) + * [zlib](https://github.com/madler/zlib); Optional: - * [libipatcher](https://github.com/s0uthwest/libipatcher) + * [libipatcher](https://github.com/s0uthwest/libipatcher); * ## Submodules Make sure these projects compile on your system (install their dependencies) * [jssy](https://github.com/tihmstar/jssy); @@ -55,43 +57,37 @@ Whenever you read "downgrade" nowadays it means you can also upgrade and re-rest ## 1) Prometheus (64-bit device) - generator method ### Requirements -- __Jailbreak__ -- SHSH2 files with a generator -- nonceEnabler patch enabled +- __Jailbreak;__ +- Signing tickets (.shsh2) files with a generator; +- nonceEnabler patch enabled; ### Info You can downgrade if the destination iOS is compatible with the latest signed SEP and if you have shsh2 files with a generator for that iOS. ### How to use -1. Device must be jailbroken and nonceEnabler patch must be active -2. Open shsh file and look up the generator - * Looks like this: `generator0xde3318d224cf14a1` -3. Write the generator to device's nvram - * SSH into the device and run `nvram com.apple.System.boot-nonce=0xde3318d224cf14a1` to set the generator *0xde3318d224cf14a1* - * verify with `nvram -p` -4. Connect your device in normal mode to computer -5. On the computer run `futurerestore -t ticket.shsh --latest-baseband --latest-sep ios.ipsw` - -### Youtube -Prometheus -*Prometheus* - -### Recommended method to active nonceEnabler patch +1. Device must be jailbroken and nonceEnabler patch must be active; +2. Open signing ticket (.shsh2) file and look up the generator: + * Looks like this: `generator0xde3318d224cf14a1`; +3. Write the boot-nonce generator to device's nvram + * SSH into the device and run `nvram com.apple.System.boot-nonce=0xde3318d224cf14a1` to set the boot-nonce generator *0xde3318d224cf14a1*; + * verify with `nvram -p` command + +### Recommended methods to activate nonceEnabler patch #### Method 1: ios-kern-utils (iOS 7.x-10.x) -1. Install DEB-file of [ios-kern-utils](https://github.com/Siguza/ios-kern-utils/releases/) on device -2. Run on the device `nvpatch com.apple.System.boot-nonce` +1. Install DEB-file of [ios-kern-utils](https://github.com/Siguza/ios-kern-utils/releases/) on device; +2. Run on the device `nvpatch com.apple.System.boot-nonce`. #### Method 2: Using special applications -Use utilities for setting boot-nonce — [PhœnixNonce](https://github.com/Siguza/PhoenixNonce) for iOS 9.x, [v0rtexnonce](https://github.com/arx8x/v0rtexnonce) for iOS 10.x, [nonceset1112](https://github.com/julioverne/NonceSet112) for iOS 11.0-11.1.2 and [noncereboot1131UI](https://github.com/s0uthwest/noncereboot1131UI) for iOS 11.0-11.4b3. +Use utilities for setting boot-nonce generator — [PhœnixNonce](https://github.com/Siguza/PhoenixNonce) for iOS 9.x, [v0rtexnonce](https://github.com/arx8x/v0rtexnonce) for iOS 10.x, [nonceset1112](https://github.com/julioverne/NonceSet112) for iOS 11.0-11.1.2 and [noncereboot1131UI](https://github.com/s0uthwest/noncereboot1131UI) for iOS 11.0-11.4b3. #### Method 3: [noncereboot11](https://github.com/pwn20wndstuff/noncereboot11) for iOS 11.x. -This CLI tool available at [pwn20wnd](https://github.com/pwn20wndstuff)'s [Cydia repo](http://xnu.science/repo). Install it and set boot-nonce with help on the binary. +This CLI tool available at [pwn20wnd](https://github.com/pwn20wndstuff)'s [Cydia repo](http://xnu.science/repo). Install it and set boot-nonce generator with help on the binary. ### Activate tfp0 if jailbreak doesn't allow it #### Method 1 (if jailbroken on 9.3.x) - * reboot - * reactivate jailbreak with [Luca Todesco](https://github.com/kpwn)'s [JailbreakMe](https://jbme.qwertyoruiop.com/) - * done + * reboot; + * reactivate jailbreak with [Luca Todesco](https://github.com/kpwn)'s [JailbreakMe](https://jbme.qwertyoruiop.com/); + * done. #### Method 2 (if jailbroken on iOS 8.0-8.1 with [Pangu8](https://en.8.pangu.io)) * install this [untether DEB-file](http://apt.saurik.com/beta/pangu8-tfp0/io.pangu.xuanyuansword8_0.5_iphoneos-arm.deb) with included tfp0 patch @@ -104,43 +100,43 @@ This CLI tool available at [pwn20wnd](https://github.com/pwn20wndstuff)'s [Cydia --- -## 2) Prometheus (64-bit device) - ApNonce collision method (Recovery) +## 2) Prometheus (64-bit device) - ApNonce collision method (Recovery mode); ### Requirements -- __iPhone 5s, iPad Air, iPad mini 2 on iOS 9.1 - 10.2__ -- No Jailbreak required -- SHSH files with customly chosen ApNonce -- The shsh file needs to have one of the ApNonces, which the device generates a lot -- __collisioned ApNonces available in file 'nonces.txt'__ +- __iPhone 5s, iPad Air, iPad mini 2 (devices with A7 chip) on iOS 9.1 - 10.2;__ +- Jailbreak doesn't required; +- Signing tickets files (.shsh, shsh2) with customly chosen ApNonce; +- The shsh file needs to have one of the ApNonces, which the device generates a lot; +- __collisioned ApNonces available in file 'nonces.txt' in [TSSChecker](https://github.com/s0uthwest/tsschecker) project.__ ### Info -You can downgrade if the destination iOS is compatible with the latest signed SEP. You also need to have special shsh files. If you don't know what this is, you probably can **NOT** use this method! +You can downgrade if the destination iOS is compatible with the latest signed SEP. You also need to have special signing tickets files. If you don't know what this is, you probably can **NOT** use this method! ### How to use -1. Connect your device in normal mode or recovery mode -2. On the computer run `futurerestore -w -t ticket.shsh --latest-baseband --latest-sep ios.ipsw` -* If you have saved multiple tickets with different nonces you can specify more than -one to speed up the process: `futurerestore -w -t t1.shsh -t t2.shsh -t t3.shsh -t t4.shsh --latest-baseband --latest-sep ios.ipsw` +1. Connect your device in normal mode or recovery mode; +2. On the computer run `futurerestore -w -t ticket.shsh --latest-baseband --latest-sep ios.ipsw`. +* If you have saved multiple tickets with different ApNonces you can specify more than +one to speed up the process: `futurerestore -w -t t1.shsh -t t2.shsh -t t3.shsh -t t4.shsh --latest-baseband --latest-sep ios.ipsw`. --- ## 3) Prometheus (64-bit device) - ApNonce collision method (DFU) ### Requirements -- __Devices for A7 chip (iPhone 5s, iPad Air, iPad mini 2) and some devices with A8 chip (iPod touch [6th gen]) on all iOS firmwares__ -- No Jailbreak required -- SHSH files with customly chosen ApNonce -- The shsh file needs to have one of the ApNonces, which the device generates a lot -- __[img4tool](https://github.com/s0uthwest/img4tool) can't be used for Windows [problem with signing iBSS/iBEC], now it's TO-DO__ -- __collisioned ApNonces available in file 'nonces.txt' in [TSSChecker](https://github.com/s0uthwest/TSSChecker).__ +- __Devices for A7 chip (iPhone 5s, iPad Air, iPad mini 2) and some devices with A8 chip (iPod touch [6th gen]) on all iOS firmwares;__ +- Jailbreak doesn't required; +- Signing tickets files (.shsh, .shsh2) with customly chosen ApNonce; +- Ticket file needs to have one of the ApNonces, which the device generates a lot; +- __[img4tool](https://github.com/s0uthwest/img4tool) can't be used for Windows [problem with signing iBSS/iBEC], now it's TO-DO;__ +- __collisioned ApNonces available in file 'nonces.txt' in [TSSChecker](https://github.com/s0uthwest/TSSChecker) project.__ ### Info -You can downgrade if the destination iOS is compatible with the latest signed SEP. You also need to have special shsh files. If you don't know what this is, you probably can **NOT** use this method! +You can downgrade if the destination iOS is compatible with the latest signed SEP. You also need to have special signing tickets files. If you don't know what this is, you probably can **NOT** use this method! ### How to use -1. Connect your device in DFU mode -2. Use [irecovery](https://github.com/libimobiledevice/irecovery) for check nonce booted with DFU -3. Extract iBSS/iBEC from target firmware for downgrade (unsigned) +1. Connect your device in DFU mode; +2. Use [irecovery](https://github.com/libimobiledevice/libirecovery) for check nonce booted with DFU; +3. Extract iBSS/iBEC from target firmware for downgrade (unsigned); 4. Check DFU ApNonces with [irecovery](https://github.com/libimobiledevice/irecovery) with DFU booting. You can't automatically collision DFU ApNonces. @@ -148,55 +144,52 @@ You can downgrade if the destination iOS is compatible with the latest signed SE __If ApNonce is successfully coliisioned, use this SHSH2 for sign iBSS/iBEC.__ 5. Use [img4tool](https://github.com/s0uthwest/img4tool/releases) for sign iBSS: - `img4tool -s ticket.shsh -c iBSS.signed -p ` + `img4tool -s ticket.shsh -c iBSS.signed -p `; 6. Use [img4tool](https://github.com/s0uthwest/img4tool/releases) for sign iBEC: - `img4tool -s ticket.shsh -c iBEC.signed -p ` + `img4tool -s ticket.shsh -c iBEC.signed -p `; 7. So, after signing we can boot into Recovery with [irecovery](https://github.com/libimobiledevice/irecovery): - `irecovery -f iBSS.signed` - loading iBSS + `irecovery -f iBSS.signed` - loading iBSS; - `irecovery -f iBEC.signed` - loading iBEC -8. So good! On the computer run `futurerestore -w -t ticket.shsh --latest-baseband --latest-sep ios.ipsw` + `irecovery -f iBEC.signed` - loading iBEC; +8. So good! On the computer run `futurerestore -w -t ticket.shsh --latest-baseband --latest-sep ios.ipsw`. --- ## 4) Odysseus (32-bit devices) ### Requirements -- futurerestore compiled with libipatcher ([Odysseus](https://dayt0n.com/articles/Odysseus) support) -- Jailbreak or bootrom exploit (limera1n) -- Firmware keys for the device/destination iOS must be public -- SHSH files for the destination iOS (OTA blobs work too!) +- futurerestore compiled with [libipatcher](https://github.com/s0uthwest/libipatcher) ([Odysseus](https://dayt0n.com/articles/Odysseus) support); +- Jailbreak or bootrom exploit (limera1n); +- Firmware keys for the device/destination iOS must be public; +- Signing tickets files (.shsh, .shsh2) for the destination iOS (OTA blobs work too!); +- _Odysseus bundle (You can use any successfully created bundle for this)._ ### Info -If you have a jailbroken 32-bit device you can downgrade to any iOS you have blobs for. You can still get OTA blobs for iOS 6.1.3 and 8.4.1 for some devices and use those. +If you have a jailbroken 32-bit device you can downgrade to any iOS you have signing tickets for. You can still get OTA tickets for some devices and use those, if there are signed. ### How to use -1. Get device into kDFU/pwnDFU +1. Get device into kDFU/pwnDFU mode: * Pre-iPhone 4s (limera1n devices): - * Enter pwndfu mode with redsn0w or any other tool + * Enter pwndfu mode with redsn0w or any other tool; * iPhone 4s and later: - * Jailbreak required! + * Jailbreak required; * Enter kDFU mode by loading a pwnediBSS from any existing odysseus bundle. 2. Connect your device to computer in kDFU mode (or pwnDFU mode) 3. On the computer run `futurerestore --use-pwndfu -t ticket.shsh --latest-baseband ios.ipsw` -### Youtube -Odysseus -*Futurerestore + Libipatcher* - -*You can use **any** successfully created odysseus bundle for this* +--- -## 5) iOS 9 Re-restore bug (found by [@alitek123](https://twitter.com/alitek123), 32-bit devices only): +## 5) iOS 9 Re-restore bug (found by [@alitek123](https://github.com/alitek12), 32-bit devices only): ### Requirements -- No Jailbreak required -- __SHSH files without a ApNonce (noNonce APTickets)__ +- Jailbreak doesn't required; +- __Signing tickets files (.shsh, .shsh2) without a ApNonce (noNonce APTickets);__ ### Info -If you have shsh files for iOS9 which do not contain an APNonce, you can restore to that firmware. +If you have signing tickets files for iOS 9.x which do not contain an ApNonce, you can restore to that firmware. ### How to use -1. Connect your device in DFU mode +1. Connect your device in DFU mode; 2. On the computer run `futurerestore -t ticket.shsh --latest-baseband ios9.ipsw` ## Credits @@ -204,4 +197,4 @@ Creator of [original project](https://github.com/tihmstar/futurerestore) - [tihm ReadMe updated on: - 2019-01-06 + 2019-01-21 From 971bf283a0b03fd1ed6c74d7b178c2f8a9ceaddb Mon Sep 17 00:00:00 2001 From: s0uthwest Date: Tue, 22 Jan 2019 12:34:10 -0800 Subject: [PATCH 31/69] TSSChecker: added iPad2,6/iPad2,7 bbgcids --- external/tsschecker | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external/tsschecker b/external/tsschecker index 8e942f75d..c5044ea60 160000 --- a/external/tsschecker +++ b/external/tsschecker @@ -1 +1 @@ -Subproject commit 8e942f75d234134344896952715438b64c498686 +Subproject commit c5044ea60e039b9271c762299461abbce51d4d6b From 099de6c14ab79aa4bd09a84467a0dc00f2beb6a3 Mon Sep 17 00:00:00 2001 From: s0uthwest Date: Tue, 22 Jan 2019 12:35:29 -0800 Subject: [PATCH 32/69] idevicerestore: add some win32 stuff in original project --- external/idevicerestore | 2 +- futurerestore/main.cpp | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/external/idevicerestore b/external/idevicerestore index 708f3d602..6306d6d6b 160000 --- a/external/idevicerestore +++ b/external/idevicerestore @@ -1 +1 @@ -Subproject commit 708f3d6027f571e2812ff75f97fa083ad2c424c1 +Subproject commit 6306d6d6b07903552228a26fdfa0e920b012b403 diff --git a/futurerestore/main.cpp b/futurerestore/main.cpp index 72fdb58e3..540493173 100644 --- a/futurerestore/main.cpp +++ b/futurerestore/main.cpp @@ -86,8 +86,7 @@ void cmd_help(){ printf(" -b, --baseband PATH\t\tBaseband to be flashed\n"); printf(" -p, --baseband-manifest PATH\tBuildManifest for requesting baseband ticket\n"); printf(" -s, --sep PATH\t\tSEP to be flashed\n"); - printf(" -m, --sep-manifest PATH\tBuildManifest for requesting sep ticket\n"); - printf("\n"); + printf(" -m, --sep-manifest PATH\tBuildManifest for requesting sep ticket\n\n"); printf("Homepage: https://github.com/s0uthwest/futurerestore\n"); printf("Original project: https://github.com/tihmstar/futurerestore\n"); } From 9678d732d683ef12e269b71f21fc29b6300aede3 Mon Sep 17 00:00:00 2001 From: s0uthwest Date: Tue, 22 Jan 2019 22:30:25 -0800 Subject: [PATCH 33/69] TSSChecker: removed non-existant Savage firmware --- external/tsschecker | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external/tsschecker b/external/tsschecker index c5044ea60..f3d647453 160000 --- a/external/tsschecker +++ b/external/tsschecker @@ -1 +1 @@ -Subproject commit c5044ea60e039b9271c762299461abbce51d4d6b +Subproject commit f3d64745398fdce69f69aaee41a01ecf92d05260 From 5aaae3f6fae15c1f16926ef8cd863413cb17458b Mon Sep 17 00:00:00 2001 From: s0uthwest Date: Tue, 22 Jan 2019 22:31:47 -0800 Subject: [PATCH 34/69] idevicerestore: replace 'tempnam' to mkstemp --- external/idevicerestore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external/idevicerestore b/external/idevicerestore index 6306d6d6b..415395abe 160000 --- a/external/idevicerestore +++ b/external/idevicerestore @@ -1 +1 @@ -Subproject commit 6306d6d6b07903552228a26fdfa0e920b012b403 +Subproject commit 415395abe2050d18335f322316e9b10b4511619b From 0921cd1f18efb829061115a93089ca80c53f2fff Mon Sep 17 00:00:00 2001 From: s0uthwest Date: Tue, 22 Jan 2019 22:33:13 -0800 Subject: [PATCH 35/69] removed unrequired zlib dependency --- ReadMe.md | 1 - configure.ac | 1 - futurerestore/Makefile.am | 4 ++-- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/ReadMe.md b/ReadMe.md index d0deaf006..ed8b07c7f 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -26,7 +26,6 @@ __NOT recommended 'u' parameter, if you update from jailbroken firmware!__ * [libplist](https://github.com/libimobiledevice/libplist); * [libirecovery](https://github.com/s0uthwest/libirecovery); * [libimobiledevice](https://github.com/libimobiledevice/libimobiledevice); - * [zlib](https://github.com/madler/zlib); Optional: * [libipatcher](https://github.com/s0uthwest/libipatcher); diff --git a/configure.ac b/configure.ac index 3fadf1ebb..3f1261a4a 100644 --- a/configure.ac +++ b/configure.ac @@ -34,7 +34,6 @@ PKG_CHECK_MODULES(libzip, libzip >= 0.10) PKG_CHECK_MODULES(libimobiledevice, libimobiledevice-1.0 >= 1.2.1) PKG_CHECK_MODULES(libfragmentzip, libfragmentzip >= 1.0) PKG_CHECK_MODULES(libirecovery, libirecovery >= 0.2.0) -PKG_CHECK_MODULES(zlib, zlib >= 1.2) AC_PROG_CC AC_PROG_CXX diff --git a/futurerestore/Makefile.am b/futurerestore/Makefile.am index 3aca59b1f..4ed2fb34d 100644 --- a/futurerestore/Makefile.am +++ b/futurerestore/Makefile.am @@ -1,5 +1,5 @@ -AM_CFLAGS = $(libplist_CFLAGS) $(libzip_CFLAGS) $(libimobiledevice_CFLAGS) $(libirecovery_CFLAGS) $(zlib_CFLAGS) $(libfragmentzip_CFLAGS) -I$(top_srcdir)/external/tsschecker/external/jssy/jssy -I$(top_srcdir)/external/tsschecker/tsschecker -I$(top_srcdir)/external/img4tool/img4tool -I$(top_srcdir)/external/idevicerestore/src -std=c++11 -AM_LDFLAGS = $(libplist_LIBS) $(libzip_LIBS) $(libimobiledevice_LIBS) $(libirecovery_LIBS) $(zlib_LIBS) $(libfragmentzip_LIBS) +AM_CFLAGS = $(libplist_CFLAGS) $(libzip_CFLAGS) $(libimobiledevice_CFLAGS) $(libirecovery_CFLAGS) $(libfragmentzip_CFLAGS) -I$(top_srcdir)/external/tsschecker/external/jssy/jssy -I$(top_srcdir)/external/tsschecker/tsschecker -I$(top_srcdir)/external/img4tool/img4tool -I$(top_srcdir)/external/idevicerestore/src -std=c++11 +AM_LDFLAGS = $(libplist_LIBS) $(libzip_LIBS) $(libimobiledevice_LIBS) $(libirecovery_LIBS) $(libfragmentzip_LIBS) if HAVE_LIBIPATCHER AM_LDFLAGS += $(libipatcher_LIBS) From d18e507b7b4b0b7ccc48df262a22845652ad04e6 Mon Sep 17 00:00:00 2001 From: s0uthwest Date: Sat, 26 Jan 2019 08:35:25 -0800 Subject: [PATCH 36/69] TSSChecker: added Savage & Yonkers firmware handling --- external/tsschecker | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external/tsschecker b/external/tsschecker index f3d647453..e7431bfa7 160000 --- a/external/tsschecker +++ b/external/tsschecker @@ -1 +1 @@ -Subproject commit f3d64745398fdce69f69aaee41a01ecf92d05260 +Subproject commit e7431bfa7cb480f77ecd8346c83d801ce1118d06 From 14e10259911a7d2a0d69a90699af775acabf354b Mon Sep 17 00:00:00 2001 From: s0uthwest Date: Sun, 27 Jan 2019 04:19:12 -0800 Subject: [PATCH 37/69] TSSChecker: removed unrequired TSS links --- .gitignore | 7 +------ external/tsschecker | 2 +- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 4f9a2caae..de0efbd64 100644 --- a/.gitignore +++ b/.gitignore @@ -7,12 +7,7 @@ aclocal.m4 autom4te.cache depcomp compile -config.h -config.h.in -config.log -config.status -config.guess -config.sub +config.* configure install-sh libtool diff --git a/external/tsschecker b/external/tsschecker index e7431bfa7..9be4a1cd8 160000 --- a/external/tsschecker +++ b/external/tsschecker @@ -1 +1 @@ -Subproject commit e7431bfa7cb480f77ecd8346c83d801ce1118d06 +Subproject commit 9be4a1cd83ba0a38082b0634b3a0ade8526f2733 From 7b6a7a7bf98f0bed422631507272efe580b45ce6 Mon Sep 17 00:00:00 2001 From: s0uthwest Date: Sun, 27 Jan 2019 04:20:18 -0800 Subject: [PATCH 38/69] img4tool: clearer --- external/img4tool | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external/img4tool b/external/img4tool index 768d445ef..d122ac25e 160000 --- a/external/img4tool +++ b/external/img4tool @@ -1 +1 @@ -Subproject commit 768d445ef60c88d144f01faecbb4889344f1405d +Subproject commit d122ac25edab1dbf937a361ae757817351261be8 From 54d7d4d39d90e1abcb4ba641b140af9b5ede8df1 Mon Sep 17 00:00:00 2001 From: s0uthwest Date: Sun, 27 Jan 2019 09:15:33 -0800 Subject: [PATCH 39/69] img4tool: disable eUICC tag in BuildManifest --- external/img4tool | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external/img4tool b/external/img4tool index d122ac25e..c7f095bd6 160000 --- a/external/img4tool +++ b/external/img4tool @@ -1 +1 @@ -Subproject commit d122ac25edab1dbf937a361ae757817351261be8 +Subproject commit c7f095bd64e207a8603a4d10c68065b9e65627ac From ac23cfa9cecbcc29f792b2d1caf88ef5e4c07dee Mon Sep 17 00:00:00 2001 From: s0uthwest Date: Sun, 27 Jan 2019 09:18:02 -0800 Subject: [PATCH 40/69] Support Face ID devices Updated idevicerestore included handling Savage / Yonkers firmwares. After commiting it you can successfully restore Face ID devices. --- ReadMe.md | 1 + external/idevicerestore | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ReadMe.md b/ReadMe.md index ed8b07c7f..91b9eaba3 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -6,6 +6,7 @@ Only use if you are sure what you're doing. Latest release available [here](https://github.com/s0uthwest/futurerestore/releases) for Windows, macOS & Linux. I'll compile only macOS & Linux version, Windows version won't be compiled. +__Face ID devices successfully restores now!__ ## Features * Supports the following downgrade methods diff --git a/external/idevicerestore b/external/idevicerestore index 415395abe..5a2339e9c 160000 --- a/external/idevicerestore +++ b/external/idevicerestore @@ -1 +1 @@ -Subproject commit 415395abe2050d18335f322316e9b10b4511619b +Subproject commit 5a2339e9c2bf8df1303a80e350f4e35c80f1d05d From 1f76b5ef09f2abb209f7f0dc96ee6cfac0f6a71a Mon Sep 17 00:00:00 2001 From: s0uthwest Date: Sun, 27 Jan 2019 09:25:59 -0800 Subject: [PATCH 41/69] Update some locale --- configure.ac | 4 ++-- futurerestore/Makefile.am | 2 +- futurerestore/config.h | 8 +++---- futurerestore/futurerestore.cpp | 42 +++++++++------------------------ futurerestore/main.cpp | 8 ++++--- setBuildVersion.sh | 4 ++-- 6 files changed, 25 insertions(+), 43 deletions(-) diff --git a/configure.ac b/configure.ac index 3f1261a4a..e4ba21e37 100644 --- a/configure.ac +++ b/configure.ac @@ -1,9 +1,9 @@ AC_PREREQ(2.64) -AC_INIT([futurerestore], [1.0], [https://github.com/s0uthwest/futurerestore/issues],, [https://github.com/s0uthwest/futurerestore]) +AC_INIT([futurerestore], [1.0], [https://github.com/s0uthwest/futurerestore/issues]) AC_CANONICAL_SYSTEM - AC_CANONICAL_HOST + # Check for operating system AC_MSG_CHECKING([whether we need platform-specific build settings]) case $host_os in diff --git a/futurerestore/Makefile.am b/futurerestore/Makefile.am index 4ed2fb34d..bcebfbff9 100644 --- a/futurerestore/Makefile.am +++ b/futurerestore/Makefile.am @@ -10,7 +10,7 @@ if WIN32 AM_CFLAGS += -DCURL_STATICLIB endif -bin_PROGRAMS = futurerestore +bin_PROGRAMS = futurerestore futurerestore_CXXFLAGS = $(AM_CFLAGS) if WIN32 futurerestore_LDFLAGS = -all-static -static-libgcc -static-libstdc++ $(AM_LDFLAGS) diff --git a/futurerestore/config.h b/futurerestore/config.h index d7bbe8a07..8423f2727 100644 --- a/futurerestore/config.h +++ b/futurerestore/config.h @@ -18,9 +18,9 @@ //idevicerestore config #define IDEVICERESTORE_NOMAIN -#undef VERSION_COMMIT_SHA -#undef VERSION_COMMIT_COUNT -#define VERSION_COMMIT_COUNT_FUTURERESTORE "undefined version number" -#define VERSION_COMMIT_SHA_FUTURERESTORE "undefined version commit" +#undef VERSION_SHA +#undef VERSION_COUNT +#define VERSION_COUNT_FUTURERESTORE "undefined version number" +#define VERSION_SHA_FUTURERESTORE "undefined version commit" #endif /* config_h */ diff --git a/futurerestore/futurerestore.cpp b/futurerestore/futurerestore.cpp index 9f6eb7f45..325b0876c 100644 --- a/futurerestore/futurerestore.cpp +++ b/futurerestore/futurerestore.cpp @@ -13,9 +13,11 @@ #include #include #include "futurerestore.hpp" + #ifdef HAVE_LIBIPATCHER #include #endif + extern "C"{ #include "common.h" #include "../external/img4tool/img4tool/img4.h" @@ -90,9 +92,9 @@ bool futurerestore::init(){ if (_didInit) return _didInit; _didInit = (check_mode(_client) != MODE_UNKNOWN); if (!(_client->image4supported = is_image4_supported(_client))){ - info("[INFO] 32bit device detected\n"); + info("[INFO] 32-bit device detected\n"); }else{ - info("[INFO] 64bit device detected\n"); + info("[INFO] 64-bit device detected\n"); if (_isPwnDfu) reterror(-90, "isPwnDfu is only allowed for 32bit devices\n"); } return _didInit; @@ -193,15 +195,14 @@ plist_t futurerestore::nonceMatchesApTickets(){ _rerestoreiOS9 = (info("Detected iOS 9 re-restore, proceeding in DFU mode\n"),true); } - unsigned char* realnonce; int realNonceSize = 0; if (_rerestoreiOS9) { - info("Skipping APNonce check\n"); + info("Skipping ApNonce check\n"); }else{ recovery_get_ap_nonce(_client, &realnonce, &realNonceSize); - info("Got APNonce from device: "); + info("Got ApNonce from device: "); int i = 0; for (i = 0; i < realNonceSize; i++) { info("%02x ", ((unsigned char *)realnonce)[i]); @@ -232,13 +233,12 @@ plist_t futurerestore::nonceMatchesApTickets(){ } } - return NULL; } const char *futurerestore::nonceMatchesIM4Ms(){ if (!_didInit) reterror(-1, "did not init\n"); - if (getDeviceMode(true) != MODE_RECOVERY) reterror(-10, "Device not in recovery mode, can't check apnonce\n"); + if (getDeviceMode(true) != MODE_RECOVERY) reterror(-10, "Device not in recovery mode, can't check ApNonce\n"); unsigned char* realnonce; int realNonceSize = 0; @@ -256,7 +256,6 @@ const char *futurerestore::nonceMatchesIM4Ms(){ } } - return NULL; } @@ -268,7 +267,7 @@ void futurerestore::waitForNonce(vectornonces, size_t nonceSize){ int realNonceSize = 0; for (auto nonce : nonces){ - info("waiting for nonce: "); + info("waiting for ApNonce: "); int i = 0; for (i = 0; i < nonceSize; i++) { info("%02x ", ((unsigned char *)nonce)[i]); @@ -306,7 +305,7 @@ void futurerestore::waitForNonce(){ vectornonces; if (!_client->image4supported) - reterror(-77, "Error: waitForNonce is not supported on 32bit devices\n"); + reterror(-77, "Error: waitForNonce is not supported on 32-bit devices\n"); for (auto im4m : _im4ms){ nonces.push_back(getBNCHFromIM4M(im4m,&nonceSize)); @@ -322,7 +321,7 @@ void futurerestore::loadAPTickets(const vector &apticketPaths){ struct stat fst; if (stat(apticketPath, &fst)) - reterror(-9, "failed to load apticket at %s\n",apticketPath); + reterror(-9, "failed to load APTicket at %s\n",apticketPath); gzFile zf = gzopen(apticketPath, "rb"); if (zf) { @@ -369,7 +368,7 @@ void futurerestore::loadAPTickets(const vector &apticketPaths){ plist_get_data_val(ticket, &im4m, &im4msize); if (!im4msize) - reterror(-38, "Error: failed to load shsh file %s\n",apticketPath); + reterror(-38, "Error: failed to load signing ticket file %s\n",apticketPath); _im4ms.push_back(im4m); _aptickets.push_back(apticket); @@ -429,7 +428,6 @@ char *futurerestore::getiBootBuild(){ return _ibootBuild; } - pair, size_t> getIPSWComponent(struct idevicerestore_client_t* client, plist_t build_identity, string component){ ptr_smart path; unsigned char* component_data = NULL; @@ -448,7 +446,6 @@ pair, size_t> getIPSWComponent(struct idevicerestore_client_t* return {(char*)component_data,component_size}; } - void futurerestore::enterPwnRecovery(plist_t build_identity, string bootargs){ #ifndef HAVE_LIBIPATCHER reterror(-404, "compiled without libipatcher"); @@ -461,7 +458,6 @@ void futurerestore::enterPwnRecovery(plist_t build_identity, string bootargs){ reterror(-91,"Unable to connect to DFU device\n"); irecv_get_mode(_client->dfu->client, &mode); - try { iBSSKeys = libipatcher::getFirmwareKey(_client->device->product_type, _client->build, "iBSS"); iBECKeys = libipatcher::getFirmwareKey(_client->device->product_type, _client->build, "iBEC"); @@ -470,11 +466,9 @@ void futurerestore::enterPwnRecovery(plist_t build_identity, string bootargs){ reterror(e.code(), "getting keys failed. Are keys publicly available?"); } - auto iBSS = getIPSWComponent(_client, build_identity, "iBSS"); iBSS = move(libipatcher::patchiBSS((char*)iBSS.first, iBSS.second, iBSSKeys)); - auto iBEC = getIPSWComponent(_client, build_identity, "iBEC"); iBEC = move(libipatcher::patchiBEC((char*)iBEC.first, iBEC.second, iBECKeys, bootargs)); @@ -941,11 +935,9 @@ int futurerestore::doRestore(const char *ipsw){ reterror(-11,"ERROR: Unable to get SHSH blobs for SEP\n"); } - if (_client->image4supported && (!_client->sepfwdatasize || !_client->sepfwdata)) reterror(-55, "SEP not loaded, refusing to continue"); - if (client->mode->index == MODE_RESTORE) { info("About to restore device... \n"); canExitRecovery = false; @@ -1017,11 +1009,9 @@ int futurerestore::doJustBoot(const char *ipsw, string bootargs){ if (!(build_identity = getBuildidentityWithBoardconfig(buildmanifest, client->device->hardware_model, 0))) reterror(-5,"ERROR: Unable to find any build identities for IPSW\n"); - /* print information about current build identity */ build_identity_print_information(build_identity); - //check for enterpwnrecovery, because we could be in DFU mode if (!_enterPwnRecoveryRequested) reterror(-6, "enterPwnRecoveryRequested is not set, but required"); @@ -1331,7 +1321,6 @@ char *futurerestore::getNonceFromSCAB(const char* scab, size_t *nonceSize){ } return NULL; - parsebnch: nonceOctet++; @@ -1341,10 +1330,8 @@ char *futurerestore::getNonceFromSCAB(const char* scab, size_t *nonceSize){ if (nonceSize) *nonceSize = asn1Len(nonceOctet).dataLen; } - error: return ret; - } uint64_t futurerestore::getEcidFromSCAB(const char* scab){ @@ -1371,11 +1358,9 @@ uint64_t futurerestore::getEcidFromSCAB(const char* scab){ } reterror(-76, "Error: can't read ecid from SCAB\n"); - parseEcid: ecidInt++; - len = asn1Len(ecidInt); ecidInt += len.sizeBytes + len.dataLen; while (len.dataLen--) { @@ -1412,7 +1397,6 @@ const char *futurerestore::getRamdiskHashFromSCAB(const char* scab, size_t *hash } return NULL; - parsebnch: nonceOctet++; @@ -1420,7 +1404,6 @@ const char *futurerestore::getRamdiskHashFromSCAB(const char* scab, size_t *hash if (hashSize) *hashSize = asn1Len(nonceOctet).dataLen; - error: return ret; } @@ -1466,7 +1449,6 @@ uint64_t futurerestore::getEcidFromIM4M(const char* im4m){ ecidInt = (char*)asn1ElementAtIndex(ecid, 1); ecidInt++; - len = asn1Len(ecidInt); ecidInt += len.sizeBytes; while (len.dataLen--) { @@ -1478,7 +1460,6 @@ uint64_t futurerestore::getEcidFromIM4M(const char* im4m){ return ret; } - char *futurerestore::getNonceFromAPTicket(const char* apticketPath){ char *ret = NULL; if (char *im4m = im4mFormShshFile(apticketPath,NULL)){ @@ -1541,7 +1522,6 @@ char *futurerestore::getPathOfElementInManifest(const char *element, const char return pathStr; } - static int zip_test_file(zip_t *za, zip_uint64_t idx, zip_uint64_t size, zip_uint32_t crc) { zip_file_t *zf; char buf[8192]; diff --git a/futurerestore/main.cpp b/futurerestore/main.cpp index 540493173..2913b0442 100644 --- a/futurerestore/main.cpp +++ b/futurerestore/main.cpp @@ -46,10 +46,12 @@ static struct option longopts[] = { { "latest-baseband", no_argument, NULL, '1' }, { "no-baseband", no_argument, NULL, '2' }, { "exit-recovery", no_argument, NULL, '5' }, + #ifdef HAVE_LIBIPATCHER { "use-pwndfu", no_argument, NULL, '3' }, { "just-boot", optional_argument, NULL, '4' }, #endif + { NULL, 0, NULL, 0 } }; @@ -64,9 +66,9 @@ void cmd_help(){ printf("Usage: futurerestore [OPTIONS] /path/to/ipsw\n"); printf("Tool, which supported latest restore unsigned firmware methods for all iOS devices.\n\n"); printf("Options:\n\n"); - printf(" -t, --apticket PATH\t\tAPTicket used for restoring\n"); + printf(" -t, --apticket PATH\t\tSigning tickets used for restoring\n"); printf(" -u, --update\t\t\tUpdate instead of erase install (requires appropriate APTicket)\n"); - printf(" \t\t\tNOT recommended to use this parameter, if you update from jailbroken firmware\n"); + printf(" \t\t\tNOT recommended to use this parameter, if you update from jailbroken firmware!\n"); printf(" -w, --wait\t\t\tKeep rebooting until ApNonce matches APTicket (ApNonce collision, unreliable)\n"); printf(" -d, --debug\t\t\tVerbose debug output (useful for error logs)\n"); printf(" --latest-sep\t\tUse latest signed sep instead of manually specifying one (may cause bad restore)\n"); @@ -104,7 +106,7 @@ int main(int argc, const char * argv[]) { int err=0; int res = -1; - printf("Version: " VERSION_COMMIT_SHA_FUTURERESTORE" - " VERSION_COMMIT_COUNT_FUTURERESTORE"\n"); // versioning + printf("Version: " VERSION_SHA_FUTURERESTORE" - " VERSION_COUNT_FUTURERESTORE"\n"); // versioning #ifdef HAVE_LIBIPATCHER printf("%s\n",libipatcher::version().c_str()); diff --git a/setBuildVersion.sh b/setBuildVersion.sh index 5ce144b3a..187739480 100755 --- a/setBuildVersion.sh +++ b/setBuildVersion.sh @@ -1,3 +1,3 @@ #!/bin/bash -sed -i '.bak' "s/.*define VERSION_COMMIT_COUNT_FUTURERESTORE.*/#define VERSION_COMMIT_COUNT_FUTURERESTORE \"$(git rev-list --count HEAD)\"/" ./futurerestore/config.h 2>/dev/null || sed -i "s/.*VERSION_COMMIT_COUNT_FUTURERESTORE.*/#define VERSION_COMMIT_COUNT_FUTURERESTORE \"$(git rev-list --count HEAD)\"/" ./futurerestore/config.h 2>/dev/null -sed -i '.bak' "s/.*define VERSION_COMMIT_SHA_FUTURERESTORE.*/#define VERSION_COMMIT_SHA_FUTURERESTORE \"$(git rev-parse HEAD)\"/" ./futurerestore/config.h 2>/dev/null || sed -i "s/.*VERSION_COMMIT_SHA_FUTURERESTORE.*/#define VERSION_COMMIT_SHA_FUTURERESTORE \"$(git rev-parse HEAD)\"/" ./futurerestore/config.h 2>/dev/null +sed -i '.bak' "s/.*define VERSION_COUNT_FUTURERESTORE.*/#define VERSION_COUNT_FUTURERESTORE \"$(git rev-list --count HEAD)\"/" ./futurerestore/config.h 2>/dev/null || sed -i "s/.*VERSION_COUNT_FUTURERESTORE.*/#define VERSION_COUNT_FUTURERESTORE \"$(git rev-list --count HEAD)\"/" ./futurerestore/config.h 2>/dev/null +sed -i '.bak' "s/.*define VERSION_SHA_FUTURERESTORE.*/#define VERSION_SHA_FUTURERESTORE \"$(git rev-parse HEAD)\"/" ./futurerestore/config.h 2>/dev/null || sed -i "s/.*VERSION_SHA_FUTURERESTORE.*/#define VERSION_SHA_FUTURERESTORE \"$(git rev-parse HEAD)\"/" ./futurerestore/config.h 2>/dev/null From 860c44ccf12364860aeefa32ceb6844ab1b3b0bf Mon Sep 17 00:00:00 2001 From: s0uthwest Date: Sun, 27 Jan 2019 09:36:30 -0800 Subject: [PATCH 42/69] Xcode: actualizing --- futurerestore.xcodeproj/project.pbxproj | 100 +++++++++++++----------- 1 file changed, 56 insertions(+), 44 deletions(-) diff --git a/futurerestore.xcodeproj/project.pbxproj b/futurerestore.xcodeproj/project.pbxproj index 7de174c21..97314a03b 100644 --- a/futurerestore.xcodeproj/project.pbxproj +++ b/futurerestore.xcodeproj/project.pbxproj @@ -7,15 +7,22 @@ objects = { /* Begin PBXBuildFile section */ - 5604B7B9219B35EE004C22EE /* libpartialzip-1.0.0.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 5604B7B8219B35EE004C22EE /* libpartialzip-1.0.0.dylib */; }; - 5604B7BB219B35F8004C22EE /* libirecovery.2.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 5604B7BA219B35F8004C22EE /* libirecovery.2.dylib */; }; - 5604B7BD219B3602004C22EE /* liblzfse.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 5604B7BC219B3602004C22EE /* liblzfse.dylib */; }; - 5604B7BF219B3611004C22EE /* libzip.5.0.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 5604B7BE219B3610004C22EE /* libzip.5.0.dylib */; }; - 5604B7C3219B3626004C22EE /* libplist.3.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 5604B7C2219B3626004C22EE /* libplist.3.dylib */; }; - 5604B7C5219B362E004C22EE /* libimobiledevice.6.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 5604B7C4219B362E004C22EE /* libimobiledevice.6.dylib */; }; 5604B7C7219B3630004C22EE /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 5604B7C6219B3630004C22EE /* libz.tbd */; }; 5604B7C9219B3632004C22EE /* libcurl.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 5604B7C8219B3632004C22EE /* libcurl.tbd */; }; - 563DA64521BBE44900844624 /* libcrypto.3.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 563DA64421BBE44900844624 /* libcrypto.3.dylib */; }; + 560D59EF21FE225200553AEC /* libcommon.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 560D59EE21FE225200553AEC /* libcommon.a */; }; + 560D59F121FE225E00553AEC /* libcrypto.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 560D59F021FE225D00553AEC /* libcrypto.a */; }; + 560D59F321FE226E00553AEC /* libfragmentzip.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 560D59F221FE226E00553AEC /* libfragmentzip.a */; }; + 560D59F521FE227700553AEC /* libimobiledevice.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 560D59F421FE227700553AEC /* libimobiledevice.a */; }; + 560D59F721FE228000553AEC /* libipatcher.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 560D59F621FE228000553AEC /* libipatcher.a */; }; + 560D59F921FE228B00553AEC /* libirecovery.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 560D59F821FE228B00553AEC /* libirecovery.a */; }; + 560D59FB21FE229700553AEC /* liblzfse.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 560D59FA21FE229600553AEC /* liblzfse.a */; }; + 560D59FD21FE22A100553AEC /* libpartialzip-1.0.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 560D59FC21FE22A100553AEC /* libpartialzip-1.0.a */; }; + 560D59FF21FE22A800553AEC /* libplist.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 560D59FE21FE22A800553AEC /* libplist.a */; }; + 560D5A0121FE22C500553AEC /* libpng16.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 560D5A0021FE22C500553AEC /* libpng16.a */; }; + 560D5A0321FE22D000553AEC /* libssl.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 560D5A0221FE22D000553AEC /* libssl.a */; }; + 560D5A0521FE22DA00553AEC /* libusbmuxd.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 560D5A0421FE22DA00553AEC /* libusbmuxd.a */; }; + 560D5A0721FE22E500553AEC /* libxpwn.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 560D5A0621FE22E500553AEC /* libxpwn.a */; }; + 560D5A0821FE235D00553AEC /* debug.h in Sources */ = {isa = PBXBuildFile; fileRef = 56163B0B21E514B00069A0B0 /* debug.h */; }; 56520BEB21B1BA91005BD3F7 /* lzssdec.c in Sources */ = {isa = PBXBuildFile; fileRef = 56520BE921B1BA90005BD3F7 /* lzssdec.c */; }; 56520BEF21B1BADE005BD3F7 /* endianness.h in Sources */ = {isa = PBXBuildFile; fileRef = 878587571D89D1C1008689F0 /* endianness.h */; }; 56520BF021B1BAE6005BD3F7 /* limera1n_payload.h in Sources */ = {isa = PBXBuildFile; fileRef = 878587661D89D1C1008689F0 /* limera1n_payload.h */; }; @@ -25,9 +32,6 @@ 56DA634021E3462300821A21 /* ptr_smart.hpp in Sources */ = {isa = PBXBuildFile; fileRef = 56520BF721B1BB13005BD3F7 /* ptr_smart.hpp */; }; 56DA634121E3462600821A21 /* jssy.hpp in Sources */ = {isa = PBXBuildFile; fileRef = 56520BF421B1BB13005BD3F7 /* jssy.hpp */; }; 56DA634221E3463900821A21 /* helper.h in Sources */ = {isa = PBXBuildFile; fileRef = 56520BF521B1BB13005BD3F7 /* helper.h */; }; - 56EF4C0921B1A8570056D405 /* libipatcher.0.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 56EF4C0821B1A8570056D405 /* libipatcher.0.dylib */; }; - 56EF4C0D21B1A8750056D405 /* libusbmuxd.4.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 56EF4C0C21B1A8750056D405 /* libusbmuxd.4.dylib */; }; - 56EF4C0F21B1A8850056D405 /* libfragmentzip.0.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 56EF4C0E21B1A8850056D405 /* libfragmentzip.0.dylib */; }; 878587471D89CFDC008689F0 /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 878587461D89CFDC008689F0 /* main.cpp */; }; 8799B0B21D89D99D002F4D5F /* futurerestore.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8799B0B01D89D99D002F4D5F /* futurerestore.cpp */; }; 8799B0B31D89DAE7002F4D5F /* idevicerestore.c in Sources */ = {isa = PBXBuildFile; fileRef = 8785875C1D89D1C1008689F0 /* idevicerestore.c */; settings = {COMPILER_FLAGS = "-D HAVE_CONFIG_H=1 "; }; }; @@ -68,18 +72,24 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - 5604B7B8219B35EE004C22EE /* libpartialzip-1.0.0.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libpartialzip-1.0.0.dylib"; path = "../../../../../usr/local/lib/libpartialzip-1.0.0.dylib"; sourceTree = ""; }; - 5604B7BA219B35F8004C22EE /* libirecovery.2.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libirecovery.2.dylib; path = ../../../../../usr/local/lib/libirecovery.2.dylib; sourceTree = ""; }; - 5604B7BC219B3602004C22EE /* liblzfse.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = liblzfse.dylib; path = ../../../../../usr/local/lib/liblzfse.dylib; sourceTree = ""; }; - 5604B7BE219B3610004C22EE /* libzip.5.0.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libzip.5.0.dylib; path = ../../../../../usr/local/lib/libzip.5.0.dylib; sourceTree = ""; }; - 5604B7C2219B3626004C22EE /* libplist.3.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libplist.3.dylib; path = ../../../../../usr/local/lib/libplist.3.dylib; sourceTree = ""; }; - 5604B7C4219B362E004C22EE /* libimobiledevice.6.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libimobiledevice.6.dylib; path = ../../../../../usr/local/lib/libimobiledevice.6.dylib; sourceTree = ""; }; 5604B7C6219B3630004C22EE /* libz.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = usr/lib/libz.tbd; sourceTree = SDKROOT; }; 5604B7C8219B3632004C22EE /* libcurl.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libcurl.tbd; path = usr/lib/libcurl.tbd; sourceTree = SDKROOT; }; + 560D59EE21FE225200553AEC /* libcommon.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libcommon.a; path = ../../../../../usr/local/lib/libcommon.a; sourceTree = ""; }; + 560D59F021FE225D00553AEC /* libcrypto.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libcrypto.a; path = ../../../../../usr/local/lib/libcrypto.a; sourceTree = ""; }; + 560D59F221FE226E00553AEC /* libfragmentzip.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libfragmentzip.a; path = ../../../../../usr/local/lib/libfragmentzip.a; sourceTree = ""; }; + 560D59F421FE227700553AEC /* libimobiledevice.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libimobiledevice.a; path = ../../../../../usr/local/lib/libimobiledevice.a; sourceTree = ""; }; + 560D59F621FE228000553AEC /* libipatcher.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libipatcher.a; path = ../../../../../usr/local/lib/libipatcher.a; sourceTree = ""; }; + 560D59F821FE228B00553AEC /* libirecovery.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libirecovery.a; path = ../../../../../usr/local/lib/libirecovery.a; sourceTree = ""; }; + 560D59FA21FE229600553AEC /* liblzfse.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = liblzfse.a; path = ../../../../../usr/local/lib/liblzfse.a; sourceTree = ""; }; + 560D59FC21FE22A100553AEC /* libpartialzip-1.0.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libpartialzip-1.0.a"; path = "../../../../../usr/local/lib/libpartialzip-1.0.a"; sourceTree = ""; }; + 560D59FE21FE22A800553AEC /* libplist.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libplist.a; path = ../../../../../usr/local/lib/libplist.a; sourceTree = ""; }; + 560D5A0021FE22C500553AEC /* libpng16.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libpng16.a; path = ../../../../../usr/local/lib/libpng16.a; sourceTree = ""; }; + 560D5A0221FE22D000553AEC /* libssl.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libssl.a; path = ../../../../../usr/local/lib/libssl.a; sourceTree = ""; }; + 560D5A0421FE22DA00553AEC /* libusbmuxd.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libusbmuxd.a; path = ../../../../../usr/local/lib/libusbmuxd.a; sourceTree = ""; }; + 560D5A0621FE22E500553AEC /* libxpwn.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libxpwn.a; path = ../../../../../usr/local/lib/libxpwn.a; sourceTree = ""; }; 56163B0B21E514B00069A0B0 /* debug.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = debug.h; sourceTree = ""; }; 563DA64221BBE40700844624 /* all.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = all.h; sourceTree = ""; }; 563DA64321BBE41C00844624 /* all.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = all.h; path = external/tsschecker/tsschecker/all.h; sourceTree = SOURCE_ROOT; }; - 563DA64421BBE44900844624 /* libcrypto.3.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libcrypto.3.dylib; path = ../../../../../usr/local/lib/libcrypto.3.dylib; sourceTree = ""; }; 56520BE921B1BA90005BD3F7 /* lzssdec.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = lzssdec.c; sourceTree = ""; }; 56520BEA21B1BA90005BD3F7 /* lzssdec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lzssdec.h; sourceTree = ""; }; 56520BF221B1BB13005BD3F7 /* jssy.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = jssy.c; path = external/tsschecker/external/jssy/jssy/jssy.c; sourceTree = SOURCE_ROOT; }; @@ -89,9 +99,6 @@ 56520BF621B1BB13005BD3F7 /* jssy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = jssy.cpp; path = external/tsschecker/external/jssy/jssy/jssy.cpp; sourceTree = SOURCE_ROOT; }; 56520BF721B1BB13005BD3F7 /* ptr_smart.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ptr_smart.hpp; path = external/tsschecker/external/jssy/jssy/ptr_smart.hpp; sourceTree = SOURCE_ROOT; }; 56520BF821B1BB13005BD3F7 /* jssy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = jssy.h; path = external/tsschecker/external/jssy/jssy/jssy.h; sourceTree = SOURCE_ROOT; }; - 56EF4C0821B1A8570056D405 /* libipatcher.0.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libipatcher.0.dylib; path = ../../../../../usr/local/lib/libipatcher.0.dylib; sourceTree = ""; }; - 56EF4C0C21B1A8750056D405 /* libusbmuxd.4.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libusbmuxd.4.dylib; path = ../../../../../usr/local/lib/libusbmuxd.4.dylib; sourceTree = ""; }; - 56EF4C0E21B1A8850056D405 /* libfragmentzip.0.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libfragmentzip.0.dylib; path = ../../../../../usr/local/lib/libfragmentzip.0.dylib; sourceTree = ""; }; 878587431D89CFDC008689F0 /* futurerestore */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = futurerestore; sourceTree = BUILT_PRODUCTS_DIR; }; 878587461D89CFDC008689F0 /* main.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = ""; }; 8785874F1D89D1C1008689F0 /* asr.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = asr.c; sourceTree = ""; }; @@ -155,18 +162,21 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 56EF4C0F21B1A8850056D405 /* libfragmentzip.0.dylib in Frameworks */, - 5604B7B9219B35EE004C22EE /* libpartialzip-1.0.0.dylib in Frameworks */, - 56EF4C0D21B1A8750056D405 /* libusbmuxd.4.dylib in Frameworks */, - 5604B7C3219B3626004C22EE /* libplist.3.dylib in Frameworks */, + 560D59FF21FE22A800553AEC /* libplist.a in Frameworks */, 5604B7C7219B3630004C22EE /* libz.tbd in Frameworks */, - 5604B7BB219B35F8004C22EE /* libirecovery.2.dylib in Frameworks */, - 563DA64521BBE44900844624 /* libcrypto.3.dylib in Frameworks */, - 5604B7BF219B3611004C22EE /* libzip.5.0.dylib in Frameworks */, + 560D59F321FE226E00553AEC /* libfragmentzip.a in Frameworks */, + 560D59F721FE228000553AEC /* libipatcher.a in Frameworks */, + 560D5A0321FE22D000553AEC /* libssl.a in Frameworks */, + 560D59F921FE228B00553AEC /* libirecovery.a in Frameworks */, + 560D5A0121FE22C500553AEC /* libpng16.a in Frameworks */, + 560D59F521FE227700553AEC /* libimobiledevice.a in Frameworks */, + 560D5A0521FE22DA00553AEC /* libusbmuxd.a in Frameworks */, + 560D59EF21FE225200553AEC /* libcommon.a in Frameworks */, + 560D59FD21FE22A100553AEC /* libpartialzip-1.0.a in Frameworks */, + 560D5A0721FE22E500553AEC /* libxpwn.a in Frameworks */, + 560D59FB21FE229700553AEC /* liblzfse.a in Frameworks */, 5604B7C9219B3632004C22EE /* libcurl.tbd in Frameworks */, - 5604B7C5219B362E004C22EE /* libimobiledevice.6.dylib in Frameworks */, - 5604B7BD219B3602004C22EE /* liblzfse.dylib in Frameworks */, - 56EF4C0921B1A8570056D405 /* libipatcher.0.dylib in Frameworks */, + 560D59F121FE225E00553AEC /* libcrypto.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -309,19 +319,22 @@ children = ( 5604B7C8219B3632004C22EE /* libcurl.tbd */, 5604B7C6219B3630004C22EE /* libz.tbd */, - 5604B7BA219B35F8004C22EE /* libirecovery.2.dylib */, - 5604B7B8219B35EE004C22EE /* libpartialzip-1.0.0.dylib */, - 5604B7C4219B362E004C22EE /* libimobiledevice.6.dylib */, - 5604B7BC219B3602004C22EE /* liblzfse.dylib */, - 5604B7C2219B3626004C22EE /* libplist.3.dylib */, - 5604B7BE219B3610004C22EE /* libzip.5.0.dylib */, - 56EF4C0821B1A8570056D405 /* libipatcher.0.dylib */, - 563DA64421BBE44900844624 /* libcrypto.3.dylib */, + 560D59EE21FE225200553AEC /* libcommon.a */, + 560D59F021FE225D00553AEC /* libcrypto.a */, + 560D59F221FE226E00553AEC /* libfragmentzip.a */, + 560D59F421FE227700553AEC /* libimobiledevice.a */, + 560D59F621FE228000553AEC /* libipatcher.a */, + 560D59F821FE228B00553AEC /* libirecovery.a */, + 560D59FA21FE229600553AEC /* liblzfse.a */, + 560D59FC21FE22A100553AEC /* libpartialzip-1.0.a */, + 560D59FE21FE22A800553AEC /* libplist.a */, + 560D5A0021FE22C500553AEC /* libpng16.a */, + 560D5A0221FE22D000553AEC /* libssl.a */, + 560D5A0421FE22DA00553AEC /* libusbmuxd.a */, 87F574CE1E151F11008D5C4D /* libSystem.tbd */, 87F574CC1E151EF8008D5C4D /* libcorecrypto.tbd */, 87F574C71E151DA6008D5C4D /* libcommonCrypto.tbd */, - 56EF4C0C21B1A8750056D405 /* libusbmuxd.4.dylib */, - 56EF4C0E21B1A8850056D405 /* libfragmentzip.0.dylib */, + 560D5A0621FE22E500553AEC /* libxpwn.a */, ); name = Frameworks; sourceTree = ""; @@ -394,7 +407,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "sed -i '.bak' \"s/.*define VERSION_COMMIT_COUNT_FUTURERESTORE.*/#define VERSION_COMMIT_COUNT_FUTURERESTORE \\\"$(git rev-list --count HEAD)\\\"/\" ./futurerestore/config.h 2>/dev/null || sed -i \"s/.*VERSION_COMMIT_COUNT_FUTURERESTORE.*/#define VERSION_COMMIT_COUNT_FUTURERESTORE \\\"$(git rev-list --count HEAD)\\\"/\" ./futurerestore/config.h 2>/dev/null\nsed -i '.bak' \"s/.*define VERSION_COMMIT_SHA_FUTURERESTORE.*/#define VERSION_COMMIT_SHA_FUTURERESTORE \\\"$(git rev-parse HEAD)\\\"/\" ./futurerestore/config.h 2>/dev/null || sed -i \"s/.*VERSION_COMMIT_SHA_FUTURERESTORE.*/#define VERSION_COMMIT_SHA_FUTURERESTORE \\\"$(git rev-parse HEAD)\\\"/\" ./futurerestore/config.h 2>/dev/null\n"; + shellScript = "sed -i '.bak' \"s/.*define VERSION_COUNT_FUTURERESTORE.*/#define VERSION_COUNT_FUTURERESTORE \\\"$(git rev-list --count HEAD)\\\"/\" ./futurerestore/config.h 2>/dev/null || sed -i \"s/.*VERSION_COUNT_FUTURERESTORE.*/#define VERSION_COUNT_FUTURERESTORE \\\"$(git rev-list --count HEAD)\\\"/\" ./futurerestore/config.h 2>/dev/null\nsed -i '.bak' \"s/.*define VERSION_SHA_FUTURERESTORE.*/#define VERSION_SHA_FUTURERESTORE \\\"$(git rev-parse HEAD)\\\"/\" ./futurerestore/config.h 2>/dev/null || sed -i \"s/.*VERSION_SHA_FUTURERESTORE.*/#define VERSION_SHA_FUTURERESTORE \\\"$(git rev-parse HEAD)\\\"/\" ./futurerestore/config.h 2>/dev/null\n\n"; }; /* End PBXShellScriptBuildPhase section */ @@ -411,6 +424,7 @@ 8799B0BC1D89DB27002F4D5F /* ipsw.c in Sources */, 56DA634221E3463900821A21 /* helper.h in Sources */, 8799B0CC1D89F7B9002F4D5F /* download.c in Sources */, + 560D5A0821FE235D00553AEC /* debug.h in Sources */, 8799B0B91D89DB0D002F4D5F /* img3.c in Sources */, 56DA634121E3462600821A21 /* jssy.hpp in Sources */, 8799B0B51D89DAFF002F4D5F /* common.c in Sources */, @@ -418,9 +432,9 @@ 8799B0B81D89DAFF002F4D5F /* recovery.c in Sources */, 8799B0B31D89DAE7002F4D5F /* idevicerestore.c in Sources */, 8799B0C81D89E2BD002F4D5F /* img4tool.c in Sources */, - 56520BEF21B1BADE005BD3F7 /* endianness.h in Sources */, 8799B0BB1D89DB12002F4D5F /* download.c in Sources */, 56520BEB21B1BA91005BD3F7 /* lzssdec.c in Sources */, + 56520BEF21B1BADE005BD3F7 /* endianness.h in Sources */, 8799B0B71D89DAFF002F4D5F /* normal.c in Sources */, 8799B0C31D89DB4B002F4D5F /* socket.c in Sources */, 8799B0C21D89DB46002F4D5F /* thread.c in Sources */, @@ -499,7 +513,6 @@ LIBRARY_SEARCH_PATHS = ( /usr/lib, /usr/local/lib, - /usr/local/opt/openssl/lib, "$(SDKROOT)/usr/lib/system", ); MACOSX_DEPLOYMENT_TARGET = 10.11; @@ -562,7 +575,6 @@ LIBRARY_SEARCH_PATHS = ( /usr/lib, /usr/local/lib, - /usr/local/opt/openssl/lib, "$(SDKROOT)/usr/lib/system", ); MACOSX_DEPLOYMENT_TARGET = 10.11; From 543751ae20c0260de20f96438135057e69ae77c6 Mon Sep 17 00:00:00 2001 From: s0uthwest Date: Sun, 27 Jan 2019 09:40:25 -0800 Subject: [PATCH 43/69] Update ReadMe --- Makefile.am | 2 +- ReadMe.md | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Makefile.am b/Makefile.am index 442721478..9cf3a6a70 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,4 +1,4 @@ AUTOMAKE_OPTIONS = foreign ACLOCAL_AMFLAGS = -I m4 SUBDIRS = external/idevicerestore external/img4tool external/tsschecker futurerestore -install installdirs: SUBDIRS = futurerestore \ No newline at end of file +install installdirs: SUBDIRS = futurerestore diff --git a/ReadMe.md b/ReadMe.md index 91b9eaba3..264180a07 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -15,11 +15,12 @@ __Face ID devices successfully restores now!__ * Re-restoring 32-bit devices to iOS 9 with [alitek123](https://github.com/alitek12) no-ApNonce method (alternative — [idevicererestore](https://github.com/s0uthwest/idevicererestore)). * Allows restoring any non-matching signed iOS/SEP/Baseband. -__NOT recommended 'u' parameter, if you update from jailbroken firmware!__ +__NOT recommended to use 'u' parameter, if you update from jailbroken firmware!__ # Dependencies * ## Runtime * On macOS, futurerestore requires no runtime dependencies, the following are only for compiling; * On Linux, [usbmuxd](https://github.com/libimobiledevice/usbmuxd) is required at runtime; + * ## External Libs Required: * [libzip](https://github.com/nih-at/libzip); @@ -30,6 +31,7 @@ __NOT recommended 'u' parameter, if you update from jailbroken firmware!__ Optional: * [libipatcher](https://github.com/s0uthwest/libipatcher); + * ## Submodules Make sure these projects compile on your system (install their dependencies) * [jssy](https://github.com/tihmstar/jssy); @@ -49,7 +51,7 @@ Follow [this guide](https://dev.to/jake/using-libcurl3-and-libcurl4-on-ubuntu-18 --- ## 0) What futurerestore can do -**Downgrade/Upgrade/Re-restore same iOS.** +**Downgrade/Upgrade/Re-restore _same_ iOS.** Whenever you read "downgrade" nowadays it means you can also upgrade and re-restore if you're on the same iOS. Basically this allows restoring an iOS and the installed iOS doesn't matter. --- @@ -96,7 +98,7 @@ This CLI tool available at [pwn20wnd](https://github.com/pwn20wndstuff)'s [Cydia * install this [untether DEB-file](http://apt.saurik.com/debs/io.pangu.axe7_0.3_iphoneos-arm.deb) with included tfp0 patch #### Method 4 - * Use [cl0ver](https://github.com/Siguza/cl0ver) for iOS 9.x + * Use [cl0ver](https://github.com/Siguza/cl0ver) for iOS 9.x. --- @@ -152,7 +154,7 @@ You can downgrade if the destination iOS is compatible with the latest signed SE `irecovery -f iBSS.signed` - loading iBSS; `irecovery -f iBEC.signed` - loading iBEC; -8. So good! On the computer run `futurerestore -w -t ticket.shsh --latest-baseband --latest-sep ios.ipsw`. +8. So good! On the computer run `futurerestore -t ticket.shsh --latest-baseband --latest-sep -w ios.ipsw`. --- @@ -197,4 +199,4 @@ Creator of [original project](https://github.com/tihmstar/futurerestore) - [tihm ReadMe updated on: - 2019-01-21 + 2019-01-27 From a6d6c01f623d5bba3d6e3225963da45c09251117 Mon Sep 17 00:00:00 2001 From: s0uthwest Date: Mon, 28 Jan 2019 02:16:24 -0800 Subject: [PATCH 44/69] idevicerestore: add some libimobiledevice / TSSChecker stuff --- external/idevicerestore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external/idevicerestore b/external/idevicerestore index 5a2339e9c..704692683 160000 --- a/external/idevicerestore +++ b/external/idevicerestore @@ -1 +1 @@ -Subproject commit 5a2339e9c2bf8df1303a80e350f4e35c80f1d05d +Subproject commit 7046926836e25eb8ce8806113ae8aa8cacc5a3dc From e9a1efd5a20c93de48c19535120d0a7af46e0e3e Mon Sep 17 00:00:00 2001 From: s0uthwest Date: Mon, 28 Jan 2019 03:21:27 -0800 Subject: [PATCH 45/69] Deleted function "extracting SEP+bb from iPSW" --- .gitignore | 23 ++-- ReadMe.md | 1 - futurerestore/futurerestore.cpp | 221 +++++++------------------------- futurerestore/futurerestore.hpp | 9 +- futurerestore/main.cpp | 69 +++++----- 5 files changed, 96 insertions(+), 227 deletions(-) diff --git a/.gitignore b/.gitignore index de0efbd64..9d44e1c26 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ *.patch *.diff -.*.swp +*.swp Makefile Makefile.in aclocal.m4 @@ -14,15 +14,14 @@ libtool ltmain.sh m4 missing -futurerestore/.DS_Store -futurerestore/*.o -futurerestore/*.la -futurerestore/*.lo -futurerestore/config.h.bak -futurerestore/futurerestore -futurerestore/futurerestore.exe -futurerestore/.libs -futurerestore/.deps +*/.DS_Store +*/*.o +*/*.la +*/*.lo +*/config.h.bak +*/futurerestore +*/futurerestore.exe +*/.libs +*/.deps stamp-h1 -.DS_Store -external/.DS_Store \ No newline at end of file +.DS_Store \ No newline at end of file diff --git a/ReadMe.md b/ReadMe.md index 264180a07..15c8a7ead 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -6,7 +6,6 @@ Only use if you are sure what you're doing. Latest release available [here](https://github.com/s0uthwest/futurerestore/releases) for Windows, macOS & Linux. I'll compile only macOS & Linux version, Windows version won't be compiled. -__Face ID devices successfully restores now!__ ## Features * Supports the following downgrade methods diff --git a/futurerestore/futurerestore.cpp b/futurerestore/futurerestore.cpp index 325b0876c..7cec61fd9 100644 --- a/futurerestore/futurerestore.cpp +++ b/futurerestore/futurerestore.cpp @@ -74,8 +74,6 @@ extern "C"{ #define safeFree(buf) if (buf) free(buf), buf = NULL #define safePlistFree(buf) if (buf) plist_free(buf), buf = NULL -static int zip_test_file(zip_t *za, zip_uint64_t idx, zip_uint64_t size, zip_uint32_t crc); - futurerestore::futurerestore(bool isUpdateInstall, bool isPwnDfu) : _isUpdateInstall(isUpdateInstall), _isPwnDfu(isPwnDfu){ _client = idevicerestore_client_new(); if (_client == NULL) throw std::string("could not create idevicerestore client\n"); @@ -95,7 +93,7 @@ bool futurerestore::init(){ info("[INFO] 32-bit device detected\n"); }else{ info("[INFO] 64-bit device detected\n"); - if (_isPwnDfu) reterror(-90, "isPwnDfu is only allowed for 32bit devices\n"); + if (_isPwnDfu) reterror(-90, "isPwnDfu is only allowed for 32-bit devices\n"); } return _didInit; } @@ -131,10 +129,12 @@ void futurerestore::putDeviceIntoRecovery(){ getDeviceMode(false); info("Found device in %s mode\n", _client->mode->string); if (_client->mode->index == MODE_NORMAL){ + #ifdef HAVE_LIBIPATCHER if (_isPwnDfu) reterror(-501, "isPwnDfu enabled, but device was found in normal mode\n"); #endif + info("Entering recovery mode...\n"); if (normal_enter_recovery(_client) < 0) { reterror(-2,"Unable to place device into recovery mode from %s mode\n", _client->mode->string); @@ -150,9 +150,9 @@ void futurerestore::putDeviceIntoRecovery(){ ){ info("requesting to get into pwnRecovery later\n"); }else if (!_client->image4supported){ - info("32bit device in DFU mode found, assuming user wants to use iOS9 re-restore bug. Not failing here\n"); + info("32-bit device in DFU mode found, assuming user wants to use iOS 9 re-restore bug. Not failing here\n"); }else{ - reterror(-3, "unsupported devicemode, please put device in recovery mode or normal mode\n"); + reterror(-3, "unsupported device mode, please put device in recovery mode or normal mode\n"); } //only needs to be freed manually when function did't throw exception @@ -168,7 +168,7 @@ void futurerestore::setAutoboot(bool val){ if (!_didInit) reterror(-1, "did not init\n"); if (getDeviceMode(false) != MODE_RECOVERY){ - reterror(-2, "can't set autoboot, when device isn't in recovery mode\n"); + reterror(-2, "can't set auto-boot, when device isn't in recovery mode\n"); } if (_client->recovery || recovery_client_new(_client) == 0) { @@ -190,7 +190,7 @@ plist_t futurerestore::nonceMatchesApTickets(){ if (!_didInit) reterror(-1, "did not init\n"); if (getDeviceMode(true) != MODE_RECOVERY){ if (getDeviceMode(false) != MODE_DFU || *_client->version != '9') - reterror(-10, "Device not in recovery mode, can't check apnonce\n"); + reterror(-10, "Device not in recovery mode, can't check ApNonce\n"); else _rerestoreiOS9 = (info("Detected iOS 9 re-restore, proceeding in DFU mode\n"),true); } @@ -228,7 +228,7 @@ plist_t futurerestore::nonceMatchesApTickets(){ ) ) ) - //either nonce needs to match or using re-restore bug in iOS 9 + //either ApNonce needs to match or using re-restore bug in iOS 9 return _aptickets[i]; } } @@ -299,13 +299,14 @@ void futurerestore::waitForNonce(vectornonces, size_t nonceSize){ setAutoboot(true); } + void futurerestore::waitForNonce(){ if (!_im4ms.size()) reterror(-1, "No IM4M loaded\n"); size_t nonceSize = 0; vectornonces; if (!_client->image4supported) - reterror(-77, "Error: waitForNonce is not supported on 32-bit devices\n"); + reterror(-77, "Error: ApNonce collisions is not supported on 32-bit devices\n"); for (auto im4m : _im4ms){ nonces.push_back(getBNCHFromIM4M(im4m,&nonceSize)); @@ -368,7 +369,7 @@ void futurerestore::loadAPTickets(const vector &apticketPaths){ plist_get_data_val(ticket, &im4m, &im4msize); if (!im4msize) - reterror(-38, "Error: failed to load signing ticket file %s\n",apticketPath); + reterror(-38, "Error: failed to load ticket %s\n",apticketPath); _im4ms.push_back(im4m); _aptickets.push_back(apticket); @@ -474,7 +475,7 @@ void futurerestore::enterPwnRecovery(plist_t build_identity, string bootargs){ bool modeIsRecovery = false; if (mode != IRECV_K_DFU_MODE) { - info("NOTE: device is not in DFU mode, assuming pwn recovery mode.\n"); + info("NOTE: device is not in DFU mode, assuming kDFU mode.\n"); for (int i=IRECV_K_RECOVERY_MODE_1; i<=IRECV_K_RECOVERY_MODE_4; i++) { if (mode == i) modeIsRecovery = true; @@ -502,7 +503,6 @@ void futurerestore::enterPwnRecovery(plist_t build_identity, string bootargs){ /* send iBEC */ info("Sending %s (%lu bytes)...\n", "iBEC", iBEC.second); - // FIXME: Did I do this right???? irecv_error_t err = irecv_send_buffer(_client->dfu->client, (unsigned char*)(char*)iBEC.first, (unsigned long)iBEC.second, 1); if (err != IRECV_E_SUCCESS) { reterror(-92,"ERROR: Unable to send %s component: %s\n", "iBSS", irecv_strerror(err)); @@ -512,7 +512,6 @@ void futurerestore::enterPwnRecovery(plist_t build_identity, string bootargs){ } dfu_client_free(_client); - sleep(7); // Reconnect to device, but this time make sure we're not still in DFU mode @@ -621,7 +620,7 @@ int futurerestore::doRestore(const char *ipsw){ if (_enterPwnRecoveryRequested) //we are in pwnDFU, so we don't need to check nonces client->tss = _aptickets.at(0); else if (!(client->tss = nonceMatchesApTickets())) - reterror(-20, "Devicenonce does not match APTicket nonce\n"); + reterror(-20, "Devicen ApNonce does not match APTicket nonce\n"); plist_dict_remove_item(client->tss, "BBTicket"); plist_dict_remove_item(client->tss, "BasebandFirmware"); @@ -745,7 +744,7 @@ int futurerestore::doRestore(const char *ipsw){ uint64_t sephashlen = 0; plist_t digest = plist_dict_get_item(sep_sep, "Digest"); if (!digest || plist_get_node_type(digest) != PLIST_DATA) - reterror(-66, "ERROR: can't find sep digest\n"); + reterror(-66, "ERROR: can't find SEP digest\n"); plist_get_data_val(digest, reinterpret_cast(&sephash), &sephashlen); @@ -754,7 +753,7 @@ int futurerestore::doRestore(const char *ipsw){ else SHA384((unsigned char*)_client->sepfwdata, (unsigned int)_client->sepfwdatasize, genHash); if (memcmp(genHash, sephash, sephashlen)) - reterror(-67, "ERROR: SEP does not match sepmanifest\n"); + reterror(-67, "ERROR: SEP does not match SEPManifest\n"); } /* print information about current build identity */ @@ -897,8 +896,8 @@ int futurerestore::doRestore(const char *ipsw){ } printf("waiting for device to reconnect... "); recovery_client_free(client); - /* this must be long enough to allow the device to run the iBEC */ - /* FIXME: Probably better to detect if the device is back then */ + /* this must be long enough to allow the device to run the iBEC + FIXME: Probably better to detect if the device is back then */ sleep(7); } @@ -932,7 +931,7 @@ int futurerestore::doRestore(const char *ipsw){ } if (_client->image4supported && get_tss_response(client, sep_build_identity, &client->septss) < 0) { - reterror(-11,"ERROR: Unable to get SHSH blobs for SEP\n"); + reterror(-11,"ERROR: Unable to get signing tickets for SEP\n"); } if (_client->image4supported && (!_client->sepfwdatasize || !_client->sepfwdata)) @@ -1012,9 +1011,9 @@ int futurerestore::doJustBoot(const char *ipsw, string bootargs){ /* print information about current build identity */ build_identity_print_information(build_identity); - //check for enterpwnrecovery, because we could be in DFU mode + //check for kDFU, because we could be in DFU mode if (!_enterPwnRecoveryRequested) - reterror(-6, "enterPwnRecoveryRequested is not set, but required"); + reterror(-6, "Device isn't in kDFU mode\n"); if (getDeviceMode(true) != MODE_DFU && getDeviceMode(false) != MODE_RECOVERY) reterror(-6, "unexpected device mode\n"); @@ -1130,7 +1129,7 @@ char *futurerestore::getLatestManifest(){ ptr_smartautofree(versVals.version); __latestFirmwareUrl = getFirmwareUrl(device, &versVals, _firmwareTokens); - if (!__latestFirmwareUrl) reterror(-21, "could not find url of latest firmware\n"); + if (!__latestFirmwareUrl) reterror(-21, "could not find URL of latest firmware\n"); __latestManifest = getBuildManifest(__latestFirmwareUrl, device, versVals.version, versVals.buildID, 0); if (!__latestManifest) reterror(-22, "could not get buildmanifest of latest firmware\n"); @@ -1146,11 +1145,12 @@ char *futurerestore::getLatestFirmwareUrl(){ void futurerestore::loadLatestBaseband(){ char *manifeststr = getLatestManifest(); char *pathStr = getPathOfElementInManifest("BasebandFirmware", manifeststr, _client, 0); - info("downloading Baseband\n\n"); + info("downloading baseband\n\n"); if (downloadPartialzip(getLatestFirmwareUrl(), pathStr, _basebandPath = BASEBAND_TMP_PATH)) reterror(-32, "could not download baseband\n"); saveStringToFile(manifeststr, BASEBAND_MANIFEST_TMP_PATH); - setBasebandPath(BASEBAND_TMP_PATH, BASEBAND_MANIFEST_TMP_PATH); + setBasebandPath(BASEBAND_TMP_PATH); + setBasebandManifestPath(BASEBAND_MANIFEST_TMP_PATH); } void futurerestore::loadLatestSep(){ @@ -1159,132 +1159,49 @@ void futurerestore::loadLatestSep(){ info("downloading SEP\n\n"); if (downloadPartialzip(getLatestFirmwareUrl(), pathStr, SEP_TMP_PATH)) reterror(-33, "could not download SEP\n"); + loadSep(SEP_TMP_PATH); saveStringToFile(manifeststr, SEP_MANIFEST_TMP_PATH); - loadSep(SEP_TMP_PATH, SEP_MANIFEST_TMP_PATH); + setSepManifestPath(SEP_MANIFEST_TMP_PATH); } -void futurerestore::loadSepFromIpsw(const char *ipswPath) { - irecv_device_t device = loadDeviceInfo(); - char *buildManifestString = nullptr; - uint32_t buildManifestSize; - plist_t buildIdentity = nullptr; - char *path = nullptr; - int unused; - - info("Extracting SEP from IPSW...\n"); - if (ipsw_extract_build_manifest(ipswPath, &_sepbuildmanifest, &unused) < 0) { - reterror(-3, "ERROR: Unable to extract BuildManifest from %s. Firmware file might be corrupt.\n", ipswPath); - } - if (build_manifest_check_compatibility(_sepbuildmanifest, device->product_type) < 0) { - reterror(-4, "ERROR: Could not make sure this firmware is suitable for the current device. Refusing to continue.\n"); - } - if (!(buildIdentity = getBuildidentityWithBoardconfig(_sepbuildmanifest, device->hardware_model, _isUpdateInstall))) { - reterror(-5, "ERROR: Unable to find any build identities in IPSW\n"); - } - if (build_identity_get_component_path(buildIdentity, "SEP", &path) < 0) { - reterror(-6, "ERROR: Failed to find SEP component path\n"); - } - if (extract_component(ipswPath, path, - reinterpret_cast(&_client->sepfwdata), - reinterpret_cast(&_client->sepfwdatasize)) < 0) { - reterror(-7, "ERROR: Failed to extract SEP from IPSW\n"); - } - - plist_to_xml(_sepbuildmanifest, &buildManifestString, &buildManifestSize); - saveStringToFile(buildManifestString, SEP_MANIFEST_TMP_PATH); - _sepbuildmanifestPath = SEP_MANIFEST_TMP_PATH; - info("Extracted SEP with size %lu\n", _client->sepfwdatasize); - - free(buildManifestString); - free(path); -} - -void futurerestore::loadBasebandFromIpsw(const char *ipswPath) { - irecv_device_t device = loadDeviceInfo(); - char *buildManifestString = nullptr; - uint32_t buildManifestSize; - plist_t buildIdentity = nullptr; - char *path = nullptr; - int unused; - uint8_t *basebandFirmware; - uint32_t basebandFirmwareSize; - - info("Extracting baseband from IPSW...\n"); - if (ipsw_extract_build_manifest(ipswPath, &_basebandbuildmanifest, &unused) < 0) { - reterror(-3, "ERROR: Unable to extract BuildManifest from %s. Firmware file might be corrupt.\n", ipswPath); - } - if (build_manifest_check_compatibility(_basebandbuildmanifest, device->product_type) < 0) { - reterror(-4, "ERROR: Could not make sure this firmware is suitable for the current device. Refusing to continue.\n"); - } - if (!(buildIdentity = getBuildidentityWithBoardconfig(_basebandbuildmanifest, device->hardware_model, _isUpdateInstall))) { - reterror(-5, "ERROR: Unable to find any build identities in IPSW\n"); - } - if (build_identity_get_component_path(buildIdentity, "BasebandFirmware", &path) < 0) { - reterror(-6, "ERROR: Failed to find BasebandFirmware component path\n"); - } - if (extract_component(ipswPath, path, &basebandFirmware, &basebandFirmwareSize) < 0) { - reterror(-7, "ERROR: Failed to extract BasebandFirmware from IPSW\n"); - } - FILE *basebandFile = fopen(BASEBAND_TMP_PATH, "wb"); - if (!basebandFile || fwrite(basebandFirmware, 1, basebandFirmwareSize, basebandFile) != basebandFirmwareSize) { - reterror(-8, "ERROR: Failed to write baseband firmware to temporary file\n"); - } - fclose(basebandFile); - - plist_to_xml(_basebandbuildmanifest, &buildManifestString, &buildManifestSize); - saveStringToFile(buildManifestString, BASEBAND_MANIFEST_TMP_PATH); - info("Extracted BasebandFirmware with size %d\n", basebandFirmwareSize); - setBasebandPath(BASEBAND_TMP_PATH, BASEBAND_MANIFEST_TMP_PATH); - - free(basebandFirmware); - free(buildManifestString); -} - -void futurerestore::loadSep(const char *sepPath, const char *sepManifestPath) { +void futurerestore::setSepManifestPath(const char *sepManifestPath){ if (!(_sepbuildmanifest = loadPlistFromFile(_sepbuildmanifestPath = sepManifestPath))) reterror(-14, "failed to load SEPManifest"); +} +void futurerestore::setBasebandManifestPath(const char *basebandManifestPath){ + if (!(_basebandbuildmanifest = loadPlistFromFile(_basebandbuildmanifestPath = basebandManifestPath))) + reterror(-14, "failed to load BasebandManifest"); +}; + +void futurerestore::loadSep(const char *sepPath){ FILE *fsep = fopen(sepPath, "rb"); if (!fsep) reterror(-15, "failed to read SEP\n"); - + fseek(fsep, 0, SEEK_END); - _client->sepfwdatasize = static_cast(ftell(fsep)); + _client->sepfwdatasize = ftell(fsep); fseek(fsep, 0, SEEK_SET); - - if (!(_client->sepfwdata = (char *) malloc(_client->sepfwdatasize))) + + if (!(_client->sepfwdata = (char*)malloc(_client->sepfwdatasize))) reterror(-15, "failed to malloc memory for SEP\n"); - - size_t freadRet = 0; + + size_t freadRet=0; if ((freadRet = fread(_client->sepfwdata, 1, _client->sepfwdatasize, fsep)) != _client->sepfwdatasize) - reterror(-15, "failed to load SEP. size=%zu but fread returned %zu\n", _client->sepfwdatasize, freadRet); - + reterror(-15, "failed to load SEP. size=%zu but fread returned %zu\n",_client->sepfwdatasize,freadRet); + fclose(fsep); } -void futurerestore::setBasebandPath(const char *basebandPath, const char *basebandManifestPath) { - if (!(_basebandbuildmanifest = loadPlistFromFile(_basebandbuildmanifestPath = basebandManifestPath))) - reterror(-14, "failed to load BasebandManifest"); - - int zerr; - zip *za = zip_open(basebandPath, 0, &zerr); - if (!za) { - reterror(-15, "failed to open baseband '%s': %d\n", basebandPath, zerr); - } - struct zip_stat st{}; - zip_int64_t entries = zip_get_num_entries(za, 0); - for (zip_uint64_t i = 0; i < entries; i++) { - zerr = zip_stat_index(za, i, 0, &st); - if (zerr == -1 || (zerr = zip_test_file(za, i, st.size, st.crc))) { - reterror(-16, "Failed to verify baseband integrity. %d\n", zerr); - } - } - info("Verified baseband integrity.\n"); - +void futurerestore::setBasebandPath(const char *basebandPath){ + FILE *fbb = fopen(basebandPath, "rb"); + if (!fbb) + reterror(-15, "failed to read baseband"); _basebandPath = basebandPath; - zip_close(za); + fclose(fbb); } +/* static methods */ inline void futurerestore::saveStringToFile(const char *str, const char *path){ FILE *f = fopen(path, "wb"); if (!f) reterror(-41,"can't save file at %s\n",path); @@ -1356,7 +1273,7 @@ uint64_t futurerestore::getEcidFromSCAB(const char* scab){ if (*ecidInt == (char)0x81) goto parseEcid; } - reterror(-76, "Error: can't read ecid from SCAB\n"); + reterror(-76, "Error: can't read ECID from SCAB\n"); parseEcid: ecidInt++; @@ -1521,43 +1438,3 @@ char *futurerestore::getPathOfElementInManifest(const char *element, const char noerror: return pathStr; } - -static int zip_test_file(zip_t *za, zip_uint64_t idx, zip_uint64_t size, zip_uint32_t crc) { - zip_file_t *zf; - char buf[8192]; - zip_uint64_t nsize; - zip_int64_t n; - zip_uint32_t ncrc; - - if ((zf = zip_fopen_index(za, idx, 0)) == NULL) { - // fprintf(stderr, "cannot open file %" PRIu64 " in archive: %s\n", idx, zip_strerror(za)); - return -1; - } - - ncrc = (zip_uint32_t) crc32(0, NULL, 0); - nsize = 0; - - while ((n = zip_fread(zf, buf, sizeof(buf))) > 0) { - nsize += (zip_uint64_t) n; - ncrc = (zip_uint32_t) crc32(ncrc, (const Bytef *) buf, (unsigned int) n); - } - - if (n < 0) { - // fprintf(stderr, "error reading file %" PRIu64 " in archive: %s\n", idx, zip_file_strerror(zf)); - zip_fclose(zf); - return -1; - } - - zip_fclose(zf); - - if (nsize != size) { - // fprintf(stderr, "file %" PRIu64 ": unexpected length %" PRId64 " (should be %" PRId64 ")\n", idx, nsize, size); - return -2; - } - if (ncrc != crc) { - // fprintf(stderr, "file %" PRIu64 ": unexpected length %x (should be %x)\n", idx, ncrc, crc); - return -2; - } - - return 0; -} diff --git a/futurerestore/futurerestore.hpp b/futurerestore/futurerestore.hpp index bb267a327..d88089edc 100644 --- a/futurerestore/futurerestore.hpp +++ b/futurerestore/futurerestore.hpp @@ -93,11 +93,11 @@ class futurerestore { char *getLatestFirmwareUrl(); void loadLatestBaseband(); void loadLatestSep(); - void loadSepFromIpsw(const char *ipswPath); - void loadBasebandFromIpsw(const char *ipswPath); - void loadSep(const char *sepPath, const char *sepManifestPath); - void setBasebandPath(const char *basebandPath, const char *basebandManifestPath); + void setSepManifestPath(const char *sepManifestPath); + void setBasebandManifestPath(const char *basebandManifestPath); + void loadSep(const char *sepPath); + void setBasebandPath(const char *basebandPath); bool isUpdateInstall(){return _isUpdateInstall;}; plist_t sepManifest(){return _sepbuildmanifest;}; @@ -122,7 +122,6 @@ class futurerestore { static plist_t loadPlistFromFile(const char *path); static void saveStringToFile(const char *str, const char *path); static char *getPathOfElementInManifest(const char *element, const char *manifeststr, struct idevicerestore_client_t* client, int isUpdateInstall); - }; #endif /* futurerestore_hpp */ diff --git a/futurerestore/main.cpp b/futurerestore/main.cpp index 2913b0442..35bcfff01 100644 --- a/futurerestore/main.cpp +++ b/futurerestore/main.cpp @@ -38,7 +38,6 @@ static struct option longopts[] = { { "baseband-manifest", required_argument, NULL, 'p' }, { "sep", required_argument, NULL, 's' }, { "sep-manifest", required_argument, NULL, 'm' }, - { "source-ipsw", required_argument, NULL, 'i' }, { "wait", no_argument, NULL, 'w' }, { "update", no_argument, NULL, 'u' }, { "debug", no_argument, NULL, 'd' }, @@ -63,32 +62,31 @@ static struct option longopts[] = { #define FLAG_IS_PWN_DFU 1 << 5 void cmd_help(){ - printf("Usage: futurerestore [OPTIONS] /path/to/ipsw\n"); - printf("Tool, which supported latest restore unsigned firmware methods for all iOS devices.\n\n"); + printf("Usage: futurerestore [OPTIONS] IPSW\n"); + printf("Tool, which supported latest restore unsigned firmware methods for iOS devices.\n\n"); printf("Options:\n\n"); printf(" -t, --apticket PATH\t\tSigning tickets used for restoring\n"); printf(" -u, --update\t\t\tUpdate instead of erase install (requires appropriate APTicket)\n"); printf(" \t\t\tNOT recommended to use this parameter, if you update from jailbroken firmware!\n"); printf(" -w, --wait\t\t\tKeep rebooting until ApNonce matches APTicket (ApNonce collision, unreliable)\n"); printf(" -d, --debug\t\t\tVerbose debug output (useful for error logs)\n"); - printf(" --latest-sep\t\tUse latest signed sep instead of manually specifying one (may cause bad restore)\n"); - printf(" --latest-baseband\t\tUse latest signed baseband instead of manually specifying one (may cause bad restore)\n"); - printf(" --no-baseband\t\tSkip checks and don't flash baseband\n"); - printf(" \t\tWARNING: only use this for device without a baseband (eg. iPod touch or some Wi-Fi only iPads)\n"); printf(" --exit-recovery\t\tExit recovery mode and quit\n"); - + #ifdef HAVE_LIBIPATCHER + printf("\nLibipatcher functions:\n"); printf(" --use-pwndfu\t\tuse this for restoring devices with Odysseus method. Device needs to be in kDFU mode already\n"); printf(" --just-boot=\"-v\"\t\tuse this to tethered boot the device from kDFU mode. You can optionally set boot-args\n"); #endif - - printf("\nTo extract baseband/SEP automatically from IPSW:\n\n"); - printf(" -i, --source-ipsw PATH\tSource IPSW to extract baseband/SEP from\n"); - printf("\nTo manually specify baseband/SEP:\n\n"); + + printf("\nManually specify options for baseband/SEP:\n\n"); printf(" -b, --baseband PATH\t\tBaseband to be flashed\n"); printf(" -p, --baseband-manifest PATH\tBuildManifest for requesting baseband ticket\n"); printf(" -s, --sep PATH\t\tSEP to be flashed\n"); - printf(" -m, --sep-manifest PATH\tBuildManifest for requesting sep ticket\n\n"); + printf(" -m, --sep-manifest PATH\tBuildManifest for requesting SEP ticket\n\n"); + printf(" --latest-sep\t\tUse latest signed sep instead of manually specifying one (may cause bad restore)\n"); + printf(" --latest-baseband\t\tUse latest signed baseband instead of manually specifying one (may cause bad restore)\n"); + printf(" --no-baseband\t\tSkip checks and don't flash baseband\n"); + printf(" \t\tWARNING: only use this for device without a baseband (eg. iPod touch or some Wi-Fi only iPads)\n"); printf("Homepage: https://github.com/s0uthwest/futurerestore\n"); printf("Original project: https://github.com/tihmstar/futurerestore\n"); } @@ -120,13 +118,15 @@ int main(int argc, const char * argv[]) { long flags = 0; bool exitRecovery = false; + int isSepManifestSigned = 0; + int isBasebandSigned = 0; + const char *ipsw = NULL; const char *basebandPath = NULL; const char *basebandManifestPath = NULL; const char *sepPath = NULL; const char *sepManifestPath = NULL; const char *bootargs = NULL; - const char *sourceIpswPath = nullptr; vector apticketPaths; @@ -138,7 +138,7 @@ int main(int argc, const char * argv[]) { return -1; } - while ((opt = getopt_long(argc, (char* const *)argv, "t:i:b:p:s:m:wud0123", longopts, &optindex)) > 0) { + while ((opt = getopt_long(argc, (char* const *)argv, "t:b:p:s:m:wud0123", longopts, &optindex)) > 0) { switch (opt) { case 't': // long option: "apticket"; can be called as short option apticketPaths.push_back(optarg); @@ -146,7 +146,7 @@ int main(int argc, const char * argv[]) { case 'b': // long option: "baseband"; can be called as short option basebandPath = optarg; break; - case 'p': // long option: "baseband-plist"; can be called as short option + case 'p': // long option: "baseband-manifest"; can be called as short option basebandManifestPath = optarg; break; case 's': // long option: "sep"; can be called as short option @@ -155,9 +155,6 @@ int main(int argc, const char * argv[]) { case 'm': // long option: "sep-manifest"; can be called as short option sepManifestPath = optarg; break; - case 'i': // long option: "source-ipsw"; can be called as short option - sourceIpswPath = optarg; - break; case 'w': // long option: "wait"; can be called as short option flags |= FLAG_WAIT; break; @@ -176,6 +173,7 @@ int main(int argc, const char * argv[]) { case '5': // long option: "exit-recovery"; exitRecovery = true; break; + #ifdef HAVE_LIBIPATCHER case '3': // long option: "no-baseband"; flags |= FLAG_IS_PWN_DFU; @@ -185,6 +183,7 @@ int main(int argc, const char * argv[]) { break; break; #endif + case 'd': // long option: "debug"; can be called as short option idevicerestore_debug = 1; break; @@ -230,8 +229,8 @@ int main(int argc, const char * argv[]) { if (!( ((apticketPaths.size() && ipsw) - && ((basebandPath && basebandManifestPath) || sourceIpswPath || (flags & FLAG_LATEST_BASEBAND) || (flags & FLAG_NO_BASEBAND)) - && ((sepPath && sepManifestPath) || sourceIpswPath || (flags & FLAG_LATEST_SEP) || client.is32bit()) + && ((basebandPath && basebandManifestPath) || ((flags & FLAG_LATEST_BASEBAND) || (flags & FLAG_NO_BASEBAND))) + && ((sepPath && sepManifestPath) || (flags & FLAG_LATEST_SEP) || client.is32bit()) ) || (ipsw && bootargs && (flags & FLAG_IS_PWN_DFU)) )) { @@ -254,19 +253,16 @@ int main(int argc, const char * argv[]) { devVals.deviceBoard = const_cast(device->hardware_model); if (flags & FLAG_LATEST_SEP) { - info("user specified to use latest signed sep (WARNING, THIS CAN CAUSE A NON-WORKING RESTORE)\n"); + info("user specified to use latest signed SEP (WARNING, THIS CAN CAUSE A NON-WORKING RESTORE)\n"); client.loadLatestSep(); - } else if (!client.is32bit()) { - if (sourceIpswPath != nullptr) { - client.loadSepFromIpsw(sourceIpswPath); - } else { - client.loadSep(sepPath, sepManifestPath); - } + }else if (!client.is32bit()){ + client.loadSep(sepPath); + client.setSepManifestPath(sepManifestPath); } versVals.basebandMode = kBasebandModeWithoutBaseband; - if (!client.is32bit() && !isManifestSignedForDevice(client.sepManifestPath(), &devVals, &versVals)) { - reterror(-3,"sep firmware isn't signed\n"); + if (!client.is32bit() && !(isSepManifestSigned = isManifestSignedForDevice(client.sepManifestPath(), &devVals, &versVals))){ + reterror(-3,"SEP firmware isn't signed\n"); } if (flags & FLAG_NO_BASEBAND){ @@ -284,11 +280,10 @@ int main(int argc, const char * argv[]) { if (flags & FLAG_LATEST_BASEBAND) { info("user specified to use latest signed baseband (WARNING, THIS CAN CAUSE A NON-WORKING RESTORE)\n"); client.loadLatestBaseband(); - } else if (sourceIpswPath != nullptr) { - client.loadBasebandFromIpsw(sourceIpswPath); } else { - client.setBasebandPath(basebandPath, basebandManifestPath); - printf("Did set sep+baseband path and firmware\n"); + client.setBasebandPath(basebandPath); + client.setBasebandManifestPath(basebandManifestPath); + printf("Did set SEP+baseband path and firmware\n"); } versVals.basebandMode = kBasebandModeOnlyBaseband; @@ -298,14 +293,14 @@ int main(int argc, const char * argv[]) { if (!(devVals.bbsnumSize = client.getBBSNumSizeFromDevice())) { printf("[WARNING] Using tsschecker's fallback BasebandSerialNumber size. This might result in invalid baseband signing status information\n"); } - if (!isManifestSignedForDevice(client.basebandManifestPath(), &devVals, &versVals)) { + if (!(isBasebandSigned = isManifestSignedForDevice(client.basebandManifestPath(), &devVals, &versVals))) { reterror(-3,"baseband firmware isn't signed\n"); } } } client.putDeviceIntoRecovery(); if (flags & FLAG_WAIT){ - printf("\n[WARNING] -w is ONLY for nonce collision! If you didn't intend this, remove the -w flag.\n\n"); + printf("\n[WARNING] -w is ONLY for ApNonce collision! If you didn't intend this, remove the -w flag.\n\n"); client.waitForNonce(); } } catch (int error) { @@ -320,7 +315,7 @@ int main(int argc, const char * argv[]) { else res = client.doRestore(ipsw); } catch (int error) { - if (error == -20) error("Set your APNonce before restoring!\n"); + if (error == -20) error("Set your ApNonce before restoring!\n"); err = error; } cout << "Done: restoring "<< (!res ? "succeeded" : "failed")<<"." < Date: Sat, 2 Feb 2019 04:09:24 -0800 Subject: [PATCH 46/69] idevicerestore: latest changes by libimobiledevice --- ReadMe.md | 2 +- external/idevicerestore | 2 +- external/img4tool | 2 +- futurerestore.xcodeproj/project.pbxproj | 18 ++++++++++++++++++ futurerestore/main.cpp | 2 +- 5 files changed, 22 insertions(+), 4 deletions(-) diff --git a/ReadMe.md b/ReadMe.md index 15c8a7ead..e6fc40b4d 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -5,7 +5,7 @@ Only use if you are sure what you're doing. --- Latest release available [here](https://github.com/s0uthwest/futurerestore/releases) for Windows, macOS & Linux. -I'll compile only macOS & Linux version, Windows version won't be compiled. +I'll compile only macOS version, Windows version won't be compiled. ## Features * Supports the following downgrade methods diff --git a/external/idevicerestore b/external/idevicerestore index 704692683..d0491f3af 160000 --- a/external/idevicerestore +++ b/external/idevicerestore @@ -1 +1 @@ -Subproject commit 7046926836e25eb8ce8806113ae8aa8cacc5a3dc +Subproject commit d0491f3af514c32f62a1b5ac982ead0ed507eda5 diff --git a/external/img4tool b/external/img4tool index c7f095bd6..d122ac25e 160000 --- a/external/img4tool +++ b/external/img4tool @@ -1 +1 @@ -Subproject commit c7f095bd64e207a8603a4d10c68065b9e65627ac +Subproject commit d122ac25edab1dbf937a361ae757817351261be8 diff --git a/futurerestore.xcodeproj/project.pbxproj b/futurerestore.xcodeproj/project.pbxproj index 97314a03b..11a41a003 100644 --- a/futurerestore.xcodeproj/project.pbxproj +++ b/futurerestore.xcodeproj/project.pbxproj @@ -7,6 +7,9 @@ objects = { /* Begin PBXBuildFile section */ + 56043D502205BEC100559249 /* json_plist.c in Sources */ = {isa = PBXBuildFile; fileRef = 56043D4C2205BEC100559249 /* json_plist.c */; }; + 56043D512205BEC100559249 /* jsmn.c in Sources */ = {isa = PBXBuildFile; fileRef = 56043D4F2205BEC100559249 /* jsmn.c */; }; + 56043D552205BF3B00559249 /* libbz2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 56043D542205BF3A00559249 /* libbz2.a */; }; 5604B7C7219B3630004C22EE /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 5604B7C6219B3630004C22EE /* libz.tbd */; }; 5604B7C9219B3632004C22EE /* libcurl.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 5604B7C8219B3632004C22EE /* libcurl.tbd */; }; 560D59EF21FE225200553AEC /* libcommon.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 560D59EE21FE225200553AEC /* libcommon.a */; }; @@ -72,6 +75,11 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 56043D4C2205BEC100559249 /* json_plist.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = json_plist.c; sourceTree = ""; }; + 56043D4D2205BEC100559249 /* json_plist.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = json_plist.h; sourceTree = ""; }; + 56043D4E2205BEC100559249 /* jsmn.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsmn.h; sourceTree = ""; }; + 56043D4F2205BEC100559249 /* jsmn.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = jsmn.c; sourceTree = ""; }; + 56043D542205BF3A00559249 /* libbz2.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libbz2.a; path = ../../../../../usr/local/Cellar/bzip2/1.0.6_1/lib/libbz2.a; sourceTree = ""; }; 5604B7C6219B3630004C22EE /* libz.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = usr/lib/libz.tbd; sourceTree = SDKROOT; }; 5604B7C8219B3632004C22EE /* libcurl.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libcurl.tbd; path = usr/lib/libcurl.tbd; sourceTree = SDKROOT; }; 560D59EE21FE225200553AEC /* libcommon.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libcommon.a; path = ../../../../../usr/local/lib/libcommon.a; sourceTree = ""; }; @@ -174,6 +182,7 @@ 560D59EF21FE225200553AEC /* libcommon.a in Frameworks */, 560D59FD21FE22A100553AEC /* libpartialzip-1.0.a in Frameworks */, 560D5A0721FE22E500553AEC /* libxpwn.a in Frameworks */, + 56043D552205BF3B00559249 /* libbz2.a in Frameworks */, 560D59FB21FE229700553AEC /* liblzfse.a in Frameworks */, 5604B7C9219B3632004C22EE /* libcurl.tbd in Frameworks */, 560D59F121FE225E00553AEC /* libcrypto.a in Frameworks */, @@ -261,6 +270,10 @@ 878587611D89D1C1008689F0 /* img4.h */, 878587621D89D1C1008689F0 /* ipsw.c */, 878587631D89D1C1008689F0 /* ipsw.h */, + 56043D4F2205BEC100559249 /* jsmn.c */, + 56043D4E2205BEC100559249 /* jsmn.h */, + 56043D4C2205BEC100559249 /* json_plist.c */, + 56043D4D2205BEC100559249 /* json_plist.h */, 878587641D89D1C1008689F0 /* limera1n.c */, 878587651D89D1C1008689F0 /* limera1n.h */, 878587661D89D1C1008689F0 /* limera1n_payload.h */, @@ -335,6 +348,7 @@ 87F574CC1E151EF8008D5C4D /* libcorecrypto.tbd */, 87F574C71E151DA6008D5C4D /* libcommonCrypto.tbd */, 560D5A0621FE22E500553AEC /* libxpwn.a */, + 56043D542205BF3A00559249 /* libbz2.a */, ); name = Frameworks; sourceTree = ""; @@ -429,6 +443,7 @@ 56DA634121E3462600821A21 /* jssy.hpp in Sources */, 8799B0B51D89DAFF002F4D5F /* common.c in Sources */, 8799B0C41D89DB55002F4D5F /* mbn.c in Sources */, + 56043D512205BEC100559249 /* jsmn.c in Sources */, 8799B0B81D89DAFF002F4D5F /* recovery.c in Sources */, 8799B0B31D89DAE7002F4D5F /* idevicerestore.c in Sources */, 8799B0C81D89E2BD002F4D5F /* img4tool.c in Sources */, @@ -450,6 +465,7 @@ 8799B0C91D89E2C3002F4D5F /* img4.c in Sources */, 8799B0CA1D89E371002F4D5F /* img4.c in Sources */, 8799B0B21D89D99D002F4D5F /* futurerestore.cpp in Sources */, + 56043D502205BEC100559249 /* json_plist.c in Sources */, 56520BFC21B1BB14005BD3F7 /* jssy.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -599,6 +615,7 @@ /usr/local/lib, /usr/lib, "$(SDKROOT)/usr/lib/system", + "$(PROJECT_DIR)", ); OTHER_CFLAGS = "-DHAVE_LIBIPATCHER"; PRODUCT_BUNDLE_IDENTIFIER = net.tihmstar.futurerestore; @@ -620,6 +637,7 @@ /usr/local/lib, /usr/lib, "$(SDKROOT)/usr/lib/system", + "$(PROJECT_DIR)", ); OTHER_CFLAGS = "-DHAVE_LIBIPATCHER"; PRODUCT_BUNDLE_IDENTIFIER = net.tihmstar.futurerestore; diff --git a/futurerestore/main.cpp b/futurerestore/main.cpp index 35bcfff01..6f690d9f7 100644 --- a/futurerestore/main.cpp +++ b/futurerestore/main.cpp @@ -86,7 +86,7 @@ void cmd_help(){ printf(" --latest-sep\t\tUse latest signed sep instead of manually specifying one (may cause bad restore)\n"); printf(" --latest-baseband\t\tUse latest signed baseband instead of manually specifying one (may cause bad restore)\n"); printf(" --no-baseband\t\tSkip checks and don't flash baseband\n"); - printf(" \t\tWARNING: only use this for device without a baseband (eg. iPod touch or some Wi-Fi only iPads)\n"); + printf(" \t\tWARNING: only use this for device without a baseband (eg. iPod touch or some Wi-Fi only iPads)\n\n"); printf("Homepage: https://github.com/s0uthwest/futurerestore\n"); printf("Original project: https://github.com/tihmstar/futurerestore\n"); } From 0c310cc00519f8e861149c6f9469592e5504592a Mon Sep 17 00:00:00 2001 From: s0uthwest Date: Sat, 2 Feb 2019 09:36:01 -0800 Subject: [PATCH 47/69] TSSChecker: re-add some bbgcids --- external/tsschecker | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external/tsschecker b/external/tsschecker index 9be4a1cd8..1c425f565 160000 --- a/external/tsschecker +++ b/external/tsschecker @@ -1 +1 @@ -Subproject commit 9be4a1cd83ba0a38082b0634b3a0ade8526f2733 +Subproject commit 1c425f5659852d87f0634f272ddaa8fd56d7486f From 265157e40a942762397a59a703c812725ead7b02 Mon Sep 17 00:00:00 2001 From: s0uthwest Date: Mon, 18 Feb 2019 09:20:28 -0800 Subject: [PATCH 48/69] img4tool: requires compiling fixes --- external/img4tool | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external/img4tool b/external/img4tool index d122ac25e..94fccc6c5 160000 --- a/external/img4tool +++ b/external/img4tool @@ -1 +1 @@ -Subproject commit d122ac25edab1dbf937a361ae757817351261be8 +Subproject commit 94fccc6c59eea336150b687085d731f13a64e87f From f4bc8146e15e6ff68b397ed9e6f1e157b1e5c009 Mon Sep 17 00:00:00 2001 From: s0uthwest Date: Mon, 18 Feb 2019 09:21:10 -0800 Subject: [PATCH 49/69] TSSChecker: fix 128 error & win64 stuff Co-Authored-By: SwiftWinds Co-Authored-By: xybp888 <8657156@qq.com> --- external/tsschecker | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external/tsschecker b/external/tsschecker index 1c425f565..6da6f532d 160000 --- a/external/tsschecker +++ b/external/tsschecker @@ -1 +1 @@ -Subproject commit 1c425f5659852d87f0634f272ddaa8fd56d7486f +Subproject commit 6da6f532d0786d75d2fed5402d0a29e78aa015a8 From 7d6b2356b029d622c1cc7d9f49511b99a1cd8827 Mon Sep 17 00:00:00 2001 From: s0uthwest Date: Mon, 18 Feb 2019 09:23:25 -0800 Subject: [PATCH 50/69] idevicerestore: added latest changes by libimobiledevice --- .gitignore | 3 ++- external/idevicerestore | 2 +- futurerestore/futurerestore.cpp | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 9d44e1c26..4d00def22 100644 --- a/.gitignore +++ b/.gitignore @@ -5,16 +5,17 @@ Makefile Makefile.in aclocal.m4 autom4te.cache -depcomp compile config.* configure +depcomp install-sh libtool ltmain.sh m4 missing */.DS_Store +*/*.a */*.o */*.la */*.lo diff --git a/external/idevicerestore b/external/idevicerestore index d0491f3af..86859c17d 160000 --- a/external/idevicerestore +++ b/external/idevicerestore @@ -1 +1 @@ -Subproject commit d0491f3af514c32f62a1b5ac982ead0ed507eda5 +Subproject commit 86859c17da329618ffe759d4d2fedace9347f8e8 diff --git a/futurerestore/futurerestore.cpp b/futurerestore/futurerestore.cpp index 7cec61fd9..dadbff99d 100644 --- a/futurerestore/futurerestore.cpp +++ b/futurerestore/futurerestore.cpp @@ -802,7 +802,7 @@ int futurerestore::doRestore(const char *ipsw){ memset(&st, '\0', sizeof(struct stat)); if (stat(tmpf, &st) == 0) { - off_t fssize = 0; + uint64_t fssize = 0; ipsw_get_file_size(client->ipsw, fsname, &fssize); if ((fssize > 0) && (st.st_size == fssize)) { info("Using cached filesystem from '%s'\n", tmpf); From 8e0075102ad3ce1efc9568600d68d451d51f5a9a Mon Sep 17 00:00:00 2001 From: s0uthwest Date: Fri, 22 Feb 2019 08:51:52 -0800 Subject: [PATCH 51/69] idevicerestore: fix error "Waiting for device" for 64-bit devices --- ReadMe.md | 10 +++++----- external/idevicerestore | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ReadMe.md b/ReadMe.md index e6fc40b4d..476a64d4d 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -1,20 +1,20 @@ # futurerestore _futurerestore is a hacked up idevicerestore wrapper, which allows manually specifying SEP and Baseband for restoring_ -Only use if you are sure what you're doing. +__Only use if you are sure what you're doing.__ --- Latest release available [here](https://github.com/s0uthwest/futurerestore/releases) for Windows, macOS & Linux. -I'll compile only macOS version, Windows version won't be compiled. +I'll compile only macOS version, Windows & Linux version won't be compiled by me. ## Features * Supports the following downgrade methods - * Prometheus 64-bit devices (generator and APNonce collision mode); + * Prometheus 64-bit devices (generator and ApNonce collision mode); * Odysseus for 32-bit devices; * Re-restoring 32-bit devices to iOS 9 with [alitek123](https://github.com/alitek12) no-ApNonce method (alternative — [idevicererestore](https://github.com/s0uthwest/idevicererestore)). * Allows restoring any non-matching signed iOS/SEP/Baseband. -__NOT recommended to use 'u' parameter, if you update from jailbroken firmware!__ +__NOT recommended to use 'u' parameter, if you update jailbroken firmware!__ # Dependencies * ## Runtime * On macOS, futurerestore requires no runtime dependencies, the following are only for compiling; @@ -198,4 +198,4 @@ Creator of [original project](https://github.com/tihmstar/futurerestore) - [tihm ReadMe updated on: - 2019-01-27 + 2019-02-18 diff --git a/external/idevicerestore b/external/idevicerestore index 86859c17d..9db1056e3 160000 --- a/external/idevicerestore +++ b/external/idevicerestore @@ -1 +1 @@ -Subproject commit 86859c17da329618ffe759d4d2fedace9347f8e8 +Subproject commit 9db1056e311e17fb4c85ee0a602efc9c439fa9ca From b8af2bc72bcb54fe1e32084cad1644ef95682b84 Mon Sep 17 00:00:00 2001 From: s0uthwest Date: Fri, 22 Feb 2019 09:40:28 -0800 Subject: [PATCH 52/69] TSSChecker: fix win64 compiling Co-Authored-By: xybp888 <8657156@qq.com> --- external/tsschecker | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external/tsschecker b/external/tsschecker index 6da6f532d..8ce7eaf0a 160000 --- a/external/tsschecker +++ b/external/tsschecker @@ -1 +1 @@ -Subproject commit 6da6f532d0786d75d2fed5402d0a29e78aa015a8 +Subproject commit 8ce7eaf0a731c39eb1e08ed6725303d6d6dd2eee From 7c6105a9a722858675bbe86cc71b3dc5298f94e1 Mon Sep 17 00:00:00 2001 From: Phukit <5014939+Phukit@users.noreply.github.com> Date: Thu, 7 Mar 2019 06:38:17 -0500 Subject: [PATCH 53/69] Update ReadMe.md (#2) Instructions for Windows 10 restoring --- ReadMe.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/ReadMe.md b/ReadMe.md index 476a64d4d..f94e96f10 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -193,6 +193,26 @@ If you have signing tickets files for iOS 9.x which do not contain an ApNonce, y 1. Connect your device in DFU mode; 2. On the computer run `futurerestore -t ticket.shsh --latest-baseband ios9.ipsw` +--- + +## 6) Windows 10 Restore +### How to use +1. Try to restore the phone, error -8 occurs +2. Leave the phone plugged in, it will stay on the Recovery screen +3. Head over to Device manager under control panel in Windows +4. Locate "Apple Recovery (iBoot) USB Composite Device (at the bottom) +5. Right click, choose "Uninstall device" - You may see a tick box that allows you to uninstall the driver software as well, tick that + + --All the three Apple mobile device entries under USB devices will disappear +6. Unplug the phone and re-plug it in +7. Go back to futurerestore and send the restore command again (just press the up arrow to get it back, then enter) + + --Error -8 is now fixed, but the process will fail again after the screen of your device has turned green +8. Go back to device manager and repeat the driver uninstall process as described above (step 4 to 6) +9. Go back to futurerestore once again and repeat the restore process +10. The phone will reboot and error -10 will also be solved. +11. The restore will now proceed and succeed + ## Credits Creator of [original project](https://github.com/tihmstar/futurerestore) - [tihmstar](https://github.com/tihmstar). From cca4daf9813ce4899c1a7cbd0425dd4395d08912 Mon Sep 17 00:00:00 2001 From: s0uthwest Date: Sun, 31 Mar 2019 07:51:38 -0700 Subject: [PATCH 54/69] TSSChecker: added support new generations of iPad --- ReadMe.md | 35 +++++++++++++++++------------------ external/img4tool | 2 +- external/tsschecker | 2 +- 3 files changed, 19 insertions(+), 20 deletions(-) diff --git a/ReadMe.md b/ReadMe.md index f94e96f10..451a8570a 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -40,6 +40,23 @@ __NOT recommended to use 'u' parameter, if you update jailbroken firmware!__ ## Report an issue You can do it [here](https://github.com/s0uthwest/futurerestore/issues). + +### Restoring on Windows 10 +1. Try to restore the phone, error -8 occurs +2. Leave the phone plugged in, it'll stay on the Recovery screen +3. Head over to Device manager under control panel in Windows +4. Locate "Apple Recovery (iBoot) USB Composite Device" (at the bottom) +5. Right click, choose "Uninstall device" - You may see a tick box that allows you to uninstall the driver software as well, tick that + +--All the three Apple mobile device entries under USB devices will disappear +6. Unplug the phone and re-plug it in +7. Go back to futurerestore and send the restore command again (just press the up arrow to get it back, then enter) + +--Error -8 is now fixed, but the process will fail again after the screen of your device has turned green +8. Go back to device manager and repeat the driver uninstall process as described above (step 4 to 6) +9. Go back to futurerestore once again and repeat the restore process +10. The phone will reboot and error -10 will also be solved. +11. The restore will now proceed and succeed. ## Compiling Simple use `bash autogen.sh && make` or use Xcode project. @@ -195,24 +212,6 @@ If you have signing tickets files for iOS 9.x which do not contain an ApNonce, y --- -## 6) Windows 10 Restore -### How to use -1. Try to restore the phone, error -8 occurs -2. Leave the phone plugged in, it will stay on the Recovery screen -3. Head over to Device manager under control panel in Windows -4. Locate "Apple Recovery (iBoot) USB Composite Device (at the bottom) -5. Right click, choose "Uninstall device" - You may see a tick box that allows you to uninstall the driver software as well, tick that - - --All the three Apple mobile device entries under USB devices will disappear -6. Unplug the phone and re-plug it in -7. Go back to futurerestore and send the restore command again (just press the up arrow to get it back, then enter) - - --Error -8 is now fixed, but the process will fail again after the screen of your device has turned green -8. Go back to device manager and repeat the driver uninstall process as described above (step 4 to 6) -9. Go back to futurerestore once again and repeat the restore process -10. The phone will reboot and error -10 will also be solved. -11. The restore will now proceed and succeed - ## Credits Creator of [original project](https://github.com/tihmstar/futurerestore) - [tihmstar](https://github.com/tihmstar). diff --git a/external/img4tool b/external/img4tool index 94fccc6c5..661a6943b 160000 --- a/external/img4tool +++ b/external/img4tool @@ -1 +1 @@ -Subproject commit 94fccc6c59eea336150b687085d731f13a64e87f +Subproject commit 661a6943b514514c43cfa6fe31e9d87b9056a788 diff --git a/external/tsschecker b/external/tsschecker index 8ce7eaf0a..14e273bd9 160000 --- a/external/tsschecker +++ b/external/tsschecker @@ -1 +1 @@ -Subproject commit 8ce7eaf0a731c39eb1e08ed6725303d6d6dd2eee +Subproject commit 14e273bd97a02df0d135991f4d77357bf3b9a92c From 2de0bc86f20e2a8b0ae7fb7347cfc80ba628c013 Mon Sep 17 00:00:00 2001 From: s0uthwest <42713499+s0uthwest@users.noreply.github.com> Date: Sun, 21 Apr 2019 23:24:41 +0300 Subject: [PATCH 55/69] ReadMe: actualizing --- ReadMe.md | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/ReadMe.md b/ReadMe.md index 451a8570a..0d09a5c10 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -1,9 +1,9 @@ # futurerestore -_futurerestore is a hacked up idevicerestore wrapper, which allows manually specifying SEP and Baseband for restoring_ +_futurerestore is a hacked up idevicerestore wrapper, which allows manually specifying SEP and Baseband for restoring._ __Only use if you are sure what you're doing.__ --- -Latest release available [here](https://github.com/s0uthwest/futurerestore/releases) for Windows, macOS & Linux. +Latest release available [here](https://github.com/s0uthwest/futurerestore/releases) for macOS & Windows. I'll compile only macOS version, Windows & Linux version won't be compiled by me. @@ -14,7 +14,7 @@ I'll compile only macOS version, Windows & Linux version won't be compiled by me * Re-restoring 32-bit devices to iOS 9 with [alitek123](https://github.com/alitek12) no-ApNonce method (alternative — [idevicererestore](https://github.com/s0uthwest/idevicererestore)). * Allows restoring any non-matching signed iOS/SEP/Baseband. -__NOT recommended to use 'u' parameter, if you update jailbroken firmware!__ +__NOT recommended to use '-u' parameter, if you update jailbroken firmware!__ # Dependencies * ## Runtime * On macOS, futurerestore requires no runtime dependencies, the following are only for compiling; @@ -42,24 +42,21 @@ __NOT recommended to use 'u' parameter, if you update jailbroken firmware!__ You can do it [here](https://github.com/s0uthwest/futurerestore/issues). ### Restoring on Windows 10 -1. Try to restore the phone, error -8 occurs -2. Leave the phone plugged in, it'll stay on the Recovery screen -3. Head over to Device manager under control panel in Windows -4. Locate "Apple Recovery (iBoot) USB Composite Device" (at the bottom) -5. Right click, choose "Uninstall device" - You may see a tick box that allows you to uninstall the driver software as well, tick that - ---All the three Apple mobile device entries under USB devices will disappear -6. Unplug the phone and re-plug it in -7. Go back to futurerestore and send the restore command again (just press the up arrow to get it back, then enter) - ---Error -8 is now fixed, but the process will fail again after the screen of your device has turned green +1. Try to restore the phone, error -8 occurs; +2. Leave the phone plugged in, it'll stay on the Recovery screen; +3. Head over to Device manager under control panel in Windows; +4. Locate "Apple Recovery (iBoot) USB Composite Device" (at the bottom); +5. Right click, choose "Uninstall device" - You may see a tick box that allows you to uninstall the driver software as well, tick that (All the three Apple mobile device entries under USB devices will disappear); +6. Unplug the phone and re-plug it in; +7. Go back to futurerestore and send the restore command again (just press the up arrow to get it back, then enter). + Error -8 is now fixed, but the process will fail again after the screen of your device has turned green; 8. Go back to device manager and repeat the driver uninstall process as described above (step 4 to 6) -9. Go back to futurerestore once again and repeat the restore process -10. The phone will reboot and error -10 will also be solved. +9. Go back to futurerestore once again and repeat the restore process; +10. The phone will reboot and error -10 will also be solved; 11. The restore will now proceed and succeed. ## Compiling -Simple use `bash autogen.sh && make` or use Xcode project. +Simple use `bash autogen.sh && make` or use Xcode project. For installing use `make install`. ### Some about curl for ubuntu Follow [this guide](https://dev.to/jake/using-libcurl3-and-libcurl4-on-ubuntu-1804-bionic-184g) to use tsschecker on Ubuntu 18.04 (Bionic) as it requires libcurl3 which cannot co-exist with libcurl4 on this OS. @@ -217,4 +214,4 @@ Creator of [original project](https://github.com/tihmstar/futurerestore) - [tihm ReadMe updated on: - 2019-02-18 + 2019-04-21 From dd132a1e83c031980c36b27f4a68854bdef8b73f Mon Sep 17 00:00:00 2001 From: s0uthwest <42713499+s0uthwest@users.noreply.github.com> Date: Mon, 22 Apr 2019 11:07:27 +0300 Subject: [PATCH 56/69] fix typos --- futurerestore/main.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/futurerestore/main.cpp b/futurerestore/main.cpp index 6f690d9f7..82df31a27 100644 --- a/futurerestore/main.cpp +++ b/futurerestore/main.cpp @@ -62,8 +62,8 @@ static struct option longopts[] = { #define FLAG_IS_PWN_DFU 1 << 5 void cmd_help(){ - printf("Usage: futurerestore [OPTIONS] IPSW\n"); - printf("Tool, which supported latest restore unsigned firmware methods for iOS devices.\n\n"); + printf("Usage: futurerestore [OPTIONS] iPSW\n"); + printf("Tool, which supported latest restore unsigned firmware methods for iOS/tvOS devices.\n\n"); printf("Options:\n\n"); printf(" -t, --apticket PATH\t\tSigning tickets used for restoring\n"); printf(" -u, --update\t\t\tUpdate instead of erase install (requires appropriate APTicket)\n"); @@ -108,9 +108,9 @@ int main(int argc, const char * argv[]) { #ifdef HAVE_LIBIPATCHER printf("%s\n",libipatcher::version().c_str()); - printf("Odysseus Support: yes\n"); + printf("Odysseus support: yes\n"); #else - printf("Odysseus Support: no\n"); + printf("Odysseus support: no\n"); #endif int optindex = 0; From 32b8a07620125cda7ea696dff3920dbc264ddef1 Mon Sep 17 00:00:00 2001 From: s0uthwest Date: Sun, 28 Apr 2019 04:06:44 -0700 Subject: [PATCH 57/69] Enable Xcode 10.2 changes for project --- external/idevicerestore | 2 +- external/img4tool | 2 +- external/tsschecker | 2 +- futurerestore.xcodeproj/project.pbxproj | 12 +++++++----- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/external/idevicerestore b/external/idevicerestore index 9db1056e3..19728af8d 160000 --- a/external/idevicerestore +++ b/external/idevicerestore @@ -1 +1 @@ -Subproject commit 9db1056e311e17fb4c85ee0a602efc9c439fa9ca +Subproject commit 19728af8db0539c4f784009ab826c6aa624e500f diff --git a/external/img4tool b/external/img4tool index 661a6943b..9dc1f0887 160000 --- a/external/img4tool +++ b/external/img4tool @@ -1 +1 @@ -Subproject commit 661a6943b514514c43cfa6fe31e9d87b9056a788 +Subproject commit 9dc1f08872e1f102a11cd69118448328a516851e diff --git a/external/tsschecker b/external/tsschecker index 14e273bd9..f1396cd8c 160000 --- a/external/tsschecker +++ b/external/tsschecker @@ -1 +1 @@ -Subproject commit 14e273bd97a02df0d135991f4d77357bf3b9a92c +Subproject commit f1396cd8c7c5cb73b10683247e68200a0e2ff431 diff --git a/futurerestore.xcodeproj/project.pbxproj b/futurerestore.xcodeproj/project.pbxproj index 11a41a003..cab28712a 100644 --- a/futurerestore.xcodeproj/project.pbxproj +++ b/futurerestore.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 47; + objectVersion = 48; objects = { /* Begin PBXBuildFile section */ @@ -389,10 +389,12 @@ }; }; buildConfigurationList = 8785873E1D89CFDC008689F0 /* Build configuration list for PBXProject "futurerestore" */; - compatibilityVersion = "Xcode 6.3"; - developmentRegion = English; + compatibilityVersion = "Xcode 8.0"; + developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( + Base, + en, ); mainGroup = 8785873A1D89CFDC008689F0; productRefGroup = 878587441D89CFDC008689F0 /* Products */; @@ -531,7 +533,7 @@ /usr/local/lib, "$(SDKROOT)/usr/lib/system", ); - MACOSX_DEPLOYMENT_TARGET = 10.11; + MACOSX_DEPLOYMENT_TARGET = 10.12; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; PRODUCT_BUNDLE_IDENTIFIER = net.tihmstar.futurerestore; @@ -593,7 +595,7 @@ /usr/local/lib, "$(SDKROOT)/usr/lib/system", ); - MACOSX_DEPLOYMENT_TARGET = 10.11; + MACOSX_DEPLOYMENT_TARGET = 10.12; MTL_ENABLE_DEBUG_INFO = NO; PRODUCT_BUNDLE_IDENTIFIER = net.tihmstar.futurerestore; PRODUCT_NAME = futurerestore; From df36db9ab3350b10034c094613f75b3d5a98ca74 Mon Sep 17 00:00:00 2001 From: s0uthwest Date: Sat, 1 Jun 2019 07:02:18 -0700 Subject: [PATCH 58/69] ReadMe: actualizing --- .gitignore | 15 +++++----- ReadMe.md | 50 +++++++++++++-------------------- futurerestore/futurerestore.cpp | 2 +- futurerestore/futurerestore.hpp | 5 ++-- 4 files changed, 30 insertions(+), 42 deletions(-) diff --git a/.gitignore b/.gitignore index 4d00def22..6656a007a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,13 @@ *.patch *.diff *.swp +*.DS_Store +*.a +*.o +*.la +*.lo +*/.libs/* +*/.deps/* Makefile Makefile.in aclocal.m4 @@ -14,15 +21,7 @@ libtool ltmain.sh m4 missing -*/.DS_Store -*/*.a -*/*.o -*/*.la -*/*.lo */config.h.bak */futurerestore */futurerestore.exe -*/.libs -*/.deps stamp-h1 -.DS_Store \ No newline at end of file diff --git a/ReadMe.md b/ReadMe.md index 0d09a5c10..122121488 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -8,7 +8,7 @@ Latest release available [here](https://github.com/s0uthwest/futurerestore/relea I'll compile only macOS version, Windows & Linux version won't be compiled by me. ## Features -* Supports the following downgrade methods +* Supports the following downgrade methods: * Prometheus 64-bit devices (generator and ApNonce collision mode); * Odysseus for 32-bit devices; * Re-restoring 32-bit devices to iOS 9 with [alitek123](https://github.com/alitek12) no-ApNonce method (alternative — [idevicererestore](https://github.com/s0uthwest/idevicererestore)). @@ -58,7 +58,7 @@ You can do it [here](https://github.com/s0uthwest/futurerestore/issues). ## Compiling Simple use `bash autogen.sh && make` or use Xcode project. For installing use `make install`. -### Some about curl for ubuntu +### Some about [cURL](https://github.com/curl/curl) for ubuntu Follow [this guide](https://dev.to/jake/using-libcurl3-and-libcurl4-on-ubuntu-1804-bionic-184g) to use tsschecker on Ubuntu 18.04 (Bionic) as it requires libcurl3 which cannot co-exist with libcurl4 on this OS. --- @@ -76,12 +76,9 @@ Whenever you read "downgrade" nowadays it means you can also upgrade and re-rest - Signing tickets (.shsh2) files with a generator; - nonceEnabler patch enabled; -### Info -You can downgrade if the destination iOS is compatible with the latest signed SEP and if you have shsh2 files with a generator for that iOS. - ### How to use 1. Device must be jailbroken and nonceEnabler patch must be active; -2. Open signing ticket (.shsh2) file and look up the generator: +2. Open signing ticket and look up the generator: * Looks like this: `generator0xde3318d224cf14a1`; 3. Write the boot-nonce generator to device's nvram * SSH into the device and run `nvram com.apple.System.boot-nonce=0xde3318d224cf14a1` to set the boot-nonce generator *0xde3318d224cf14a1*; @@ -93,10 +90,10 @@ You can downgrade if the destination iOS is compatible with the latest signed SE 2. Run on the device `nvpatch com.apple.System.boot-nonce`. #### Method 2: Using special applications -Use utilities for setting boot-nonce generator — [PhœnixNonce](https://github.com/Siguza/PhoenixNonce) for iOS 9.x, [v0rtexnonce](https://github.com/arx8x/v0rtexnonce) for iOS 10.x, [nonceset1112](https://github.com/julioverne/NonceSet112) for iOS 11.0-11.1.2 and [noncereboot1131UI](https://github.com/s0uthwest/noncereboot1131UI) for iOS 11.0-11.4b3. +Use utilities for setting boot-nonce generator — [PhœnixNonce](https://github.com/Siguza/PhoenixNonce) for iOS 9.x, [v0rtexnonce](https://github.com/arx8x/v0rtexnonce) for iOS 10.x, [nonceset1112](https://github.com/julioverne/NonceSet112) for iOS 11.0-11.1.2, [noncereboot1131UI](https://github.com/s0uthwest/noncereboot1131UI) for iOS 11.0-11.4b3, [NonceReboot12xx](https://github.com/ur0/NonceReboot12XX) for iOS 12.0-12.1.2. -#### Method 3: [noncereboot11](https://github.com/pwn20wndstuff/noncereboot11) for iOS 11.x. -This CLI tool available at [pwn20wnd](https://github.com/pwn20wndstuff)'s [Cydia repo](http://xnu.science/repo). Install it and set boot-nonce generator with help on the binary. +#### Method 3: Using jailbreak tools +Use jailbreak tools for setting boot-nonce generator - [backr00m](https://nito.tv) for tvOS 10.2-11.1, [Electra](https://coolstar.org/electra) for iOS 11.x, [unc0ver](https://github.com/pwn20wndstuff/Undecimus/releases) for iOS 11.0-12.1.2 and [Chimera](https://chimera.sh) for iOS 12.0-12.1.2. ### Activate tfp0 if jailbreak doesn't allow it #### Method 1 (if jailbroken on 9.3.x) @@ -120,34 +117,28 @@ This CLI tool available at [pwn20wnd](https://github.com/pwn20wndstuff)'s [Cydia ### Requirements - __iPhone 5s, iPad Air, iPad mini 2 (devices with A7 chip) on iOS 9.1 - 10.2;__ - Jailbreak doesn't required; -- Signing tickets files (.shsh, shsh2) with customly chosen ApNonce; -- The shsh file needs to have one of the ApNonces, which the device generates a lot; +- Signing tickets (.shsh, shsh2) with customly chosen ApNonce; +- Ticket needs to have one of the ApNonces, which the device generates a lot; - __collisioned ApNonces available in file 'nonces.txt' in [TSSChecker](https://github.com/s0uthwest/tsschecker) project.__ -### Info -You can downgrade if the destination iOS is compatible with the latest signed SEP. You also need to have special signing tickets files. If you don't know what this is, you probably can **NOT** use this method! - ### How to use -1. Connect your device in normal mode or recovery mode; +1. Connect your device in normal / recovery mode; 2. On the computer run `futurerestore -w -t ticket.shsh --latest-baseband --latest-sep ios.ipsw`. * If you have saved multiple tickets with different ApNonces you can specify more than one to speed up the process: `futurerestore -w -t t1.shsh -t t2.shsh -t t3.shsh -t t4.shsh --latest-baseband --latest-sep ios.ipsw`. --- -## 3) Prometheus (64-bit device) - ApNonce collision method (DFU) +## 3) Prometheus (64-bit device) - ApNonce collision method (DFU mode); ### Requirements - __Devices for A7 chip (iPhone 5s, iPad Air, iPad mini 2) and some devices with A8 chip (iPod touch [6th gen]) on all iOS firmwares;__ - Jailbreak doesn't required; -- Signing tickets files (.shsh, .shsh2) with customly chosen ApNonce; -- Ticket file needs to have one of the ApNonces, which the device generates a lot; +- Signing tickets (.shsh, .shsh2) with customly chosen ApNonce; +- Ticket needs to have one of the ApNonces, which the device generates a lot; - __[img4tool](https://github.com/s0uthwest/img4tool) can't be used for Windows [problem with signing iBSS/iBEC], now it's TO-DO;__ - __collisioned ApNonces available in file 'nonces.txt' in [TSSChecker](https://github.com/s0uthwest/TSSChecker) project.__ -### Info -You can downgrade if the destination iOS is compatible with the latest signed SEP. You also need to have special signing tickets files. If you don't know what this is, you probably can **NOT** use this method! - ### How to use 1. Connect your device in DFU mode; 2. Use [irecovery](https://github.com/libimobiledevice/libirecovery) for check nonce booted with DFU; @@ -174,22 +165,19 @@ You can downgrade if the destination iOS is compatible with the latest signed SE ## 4) Odysseus (32-bit devices) ### Requirements -- futurerestore compiled with [libipatcher](https://github.com/s0uthwest/libipatcher) ([Odysseus](https://dayt0n.com/articles/Odysseus) support); +- futurerestore compiled with [libipatcher](https://github.com/s0uthwest/libipatcher) ([Odysseus](https://dayt0n.com/articles/Odysseus) method support); - Jailbreak or bootrom exploit (limera1n); - Firmware keys for the device/destination iOS must be public; -- Signing tickets files (.shsh, .shsh2) for the destination iOS (OTA blobs work too!); +- Signing tickets (.shsh, .shsh2) for the destination iOS (OTA blobs work too!); - _Odysseus bundle (You can use any successfully created bundle for this)._ -### Info -If you have a jailbroken 32-bit device you can downgrade to any iOS you have signing tickets for. You can still get OTA tickets for some devices and use those, if there are signed. - ### How to use 1. Get device into kDFU/pwnDFU mode: * Pre-iPhone 4s (limera1n devices): - * Enter pwndfu mode with redsn0w or any other tool; + * Enter pwnDFU mode with redsn0w or any other tool; * iPhone 4s and later: * Jailbreak required; - * Enter kDFU mode by loading a pwnediBSS from any existing odysseus bundle. + * Enter kDFU mode by loading a pwnediBSS from any existing Odysseus bundle. 2. Connect your device to computer in kDFU mode (or pwnDFU mode) 3. On the computer run `futurerestore --use-pwndfu -t ticket.shsh --latest-baseband ios.ipsw` @@ -198,10 +186,10 @@ If you have a jailbroken 32-bit device you can downgrade to any iOS you have sig ## 5) iOS 9 Re-restore bug (found by [@alitek123](https://github.com/alitek12), 32-bit devices only): ### Requirements - Jailbreak doesn't required; -- __Signing tickets files (.shsh, .shsh2) without a ApNonce (noNonce APTickets);__ +- __Signing tickets (.shsh, .shsh2) without a ApNonce (noNonce APTickets);__ ### Info -If you have signing tickets files for iOS 9.x which do not contain an ApNonce, you can restore to that firmware. +If you have signing tickets for iOS 9.x which do not contain an ApNonce, you can restore to that firmware. ### How to use 1. Connect your device in DFU mode; @@ -214,4 +202,4 @@ Creator of [original project](https://github.com/tihmstar/futurerestore) - [tihm ReadMe updated on: - 2019-04-21 + 2019-06-01 diff --git a/futurerestore/futurerestore.cpp b/futurerestore/futurerestore.cpp index dadbff99d..221017415 100644 --- a/futurerestore/futurerestore.cpp +++ b/futurerestore/futurerestore.cpp @@ -12,12 +12,12 @@ #include #include #include -#include "futurerestore.hpp" #ifdef HAVE_LIBIPATCHER #include #endif +#include "futurerestore.hpp" extern "C"{ #include "common.h" #include "../external/img4tool/img4tool/img4.h" diff --git a/futurerestore/futurerestore.hpp b/futurerestore/futurerestore.hpp index d88089edc..a8b4c0865 100644 --- a/futurerestore/futurerestore.hpp +++ b/futurerestore/futurerestore.hpp @@ -13,9 +13,10 @@ #include #include #include -#include "idevicerestore.h" -#include + #include +#include +#include "idevicerestore.h" #if defined _WIN32 || defined __CYGWIN__ #ifndef WIN32 From 473012ed3a7acb000afef773644e14463a129a82 Mon Sep 17 00:00:00 2001 From: s0uthwest Date: Sat, 1 Jun 2019 07:03:56 -0700 Subject: [PATCH 59/69] TSSChecker: added support iPod9,1 [iPod touch 7th gen]) --- external/tsschecker | 2 +- futurerestore/main.cpp | 25 +++++++++++++++---------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/external/tsschecker b/external/tsschecker index f1396cd8c..afa757e5e 160000 --- a/external/tsschecker +++ b/external/tsschecker @@ -1 +1 @@ -Subproject commit f1396cd8c7c5cb73b10683247e68200a0e2ff431 +Subproject commit afa757e5e77ebdb95b553be4ca2e12d6910cc6d0 diff --git a/futurerestore/main.cpp b/futurerestore/main.cpp index 82df31a27..0247aa31a 100644 --- a/futurerestore/main.cpp +++ b/futurerestore/main.cpp @@ -15,6 +15,7 @@ #include #include #include + #include "futurerestore.hpp" #include "tsschecker.h" @@ -63,30 +64,34 @@ static struct option longopts[] = { void cmd_help(){ printf("Usage: futurerestore [OPTIONS] iPSW\n"); - printf("Tool, which supported latest restore unsigned firmware methods for iOS/tvOS devices.\n\n"); - printf("Options:\n\n"); + printf("Tool, which supported latest restore unsigned firmware methods for iOS/tvOS devices.\n"); + + printf("\nGeneral options:\n"); printf(" -t, --apticket PATH\t\tSigning tickets used for restoring\n"); printf(" -u, --update\t\t\tUpdate instead of erase install (requires appropriate APTicket)\n"); printf(" \t\t\tNOT recommended to use this parameter, if you update from jailbroken firmware!\n"); printf(" -w, --wait\t\t\tKeep rebooting until ApNonce matches APTicket (ApNonce collision, unreliable)\n"); printf(" -d, --debug\t\t\tVerbose debug output (useful for error logs)\n"); printf(" --exit-recovery\t\tExit recovery mode and quit\n"); - + + printf("\nOptions for SEP:\n"); + printf(" --latest-sep\t\tUse latest signed sep instead of manually specifying one (may cause bad restore)\n"); + printf(" -s, --sep PATH\t\tSEP to be flashed\n"); + printf(" -m, --sep-manifest PATH\tBuildManifest for requesting SEP ticket\n"); + #ifdef HAVE_LIBIPATCHER - printf("\nLibipatcher functions:\n"); + printf("\nOptions for Odysseus method:\n"); printf(" --use-pwndfu\t\tuse this for restoring devices with Odysseus method. Device needs to be in kDFU mode already\n"); printf(" --just-boot=\"-v\"\t\tuse this to tethered boot the device from kDFU mode. You can optionally set boot-args\n"); #endif - - printf("\nManually specify options for baseband/SEP:\n\n"); + + printf("\nOptions for baseband:\n"); + printf(" --latest-baseband\t\tUse latest signed baseband instead of manually specifying one (may cause bad restore)\n"); printf(" -b, --baseband PATH\t\tBaseband to be flashed\n"); printf(" -p, --baseband-manifest PATH\tBuildManifest for requesting baseband ticket\n"); - printf(" -s, --sep PATH\t\tSEP to be flashed\n"); - printf(" -m, --sep-manifest PATH\tBuildManifest for requesting SEP ticket\n\n"); - printf(" --latest-sep\t\tUse latest signed sep instead of manually specifying one (may cause bad restore)\n"); - printf(" --latest-baseband\t\tUse latest signed baseband instead of manually specifying one (may cause bad restore)\n"); printf(" --no-baseband\t\tSkip checks and don't flash baseband\n"); printf(" \t\tWARNING: only use this for device without a baseband (eg. iPod touch or some Wi-Fi only iPads)\n\n"); + printf("Homepage: https://github.com/s0uthwest/futurerestore\n"); printf("Original project: https://github.com/tihmstar/futurerestore\n"); } From 517047939479d2b695654b8cdffdeb7dc2cb8768 Mon Sep 17 00:00:00 2001 From: s0uthwest Date: Sat, 1 Jun 2019 07:04:27 -0700 Subject: [PATCH 60/69] idevicerestore: update common library for compatibility with latest version of libusbmuxd --- external/idevicerestore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external/idevicerestore b/external/idevicerestore index 19728af8d..b36339e2a 160000 --- a/external/idevicerestore +++ b/external/idevicerestore @@ -1 +1 @@ -Subproject commit 19728af8db0539c4f784009ab826c6aa624e500f +Subproject commit b36339e2a44e8e56c26063b898c86bc6d724b62b From 5408e9f82918e8fe096e1fd8cc1bf3091da83c6b Mon Sep 17 00:00:00 2001 From: s0uthwest <42713499+s0uthwest@users.noreply.github.com> Date: Sat, 1 Jun 2019 22:21:00 +0300 Subject: [PATCH 61/69] ReadMe: updated DFU collision instruction --- ReadMe.md | 57 +++++++++++++++++++++++++++++++++---------------------- 1 file changed, 34 insertions(+), 23 deletions(-) diff --git a/ReadMe.md b/ReadMe.md index 122121488..8f2f2256f 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -42,17 +42,18 @@ __NOT recommended to use '-u' parameter, if you update jailbroken firmware!__ You can do it [here](https://github.com/s0uthwest/futurerestore/issues). ### Restoring on Windows 10 -1. Try to restore the phone, error -8 occurs; -2. Leave the phone plugged in, it'll stay on the Recovery screen; -3. Head over to Device manager under control panel in Windows; +1. Try to restore the device, error -8 occurs; +2. Leave the device plugged in, it'll stay on the Recovery screen; +3. Head over to device manager under control panel in Windows; 4. Locate "Apple Recovery (iBoot) USB Composite Device" (at the bottom); -5. Right click, choose "Uninstall device" - You may see a tick box that allows you to uninstall the driver software as well, tick that (All the three Apple mobile device entries under USB devices will disappear); -6. Unplug the phone and re-plug it in; +5. Right click and choose "Uninstall device". + You may see a tick box that allows you to uninstall the driver software as well, tick that (all the three Apple mobile device entries under USB devices will disappear); +6. Unplug the device and re-plug it in; 7. Go back to futurerestore and send the restore command again (just press the up arrow to get it back, then enter). Error -8 is now fixed, but the process will fail again after the screen of your device has turned green; -8. Go back to device manager and repeat the driver uninstall process as described above (step 4 to 6) +8. Go back to device manager and repeat the driver uninstall process as described above (step 4 to 6); 9. Go back to futurerestore once again and repeat the restore process; -10. The phone will reboot and error -10 will also be solved; +10. The device will reboot and error -10 will also be solved; 11. The restore will now proceed and succeed. ## Compiling @@ -74,29 +75,38 @@ Whenever you read "downgrade" nowadays it means you can also upgrade and re-rest ### Requirements - __Jailbreak;__ - Signing tickets (.shsh2) files with a generator; -- nonceEnabler patch enabled; +- nonceEnabler patch enabled (on iOS 11 and later it's enabled automatically); ### How to use 1. Device must be jailbroken and nonceEnabler patch must be active; 2. Open signing ticket and look up the generator: * Looks like this: `generator0xde3318d224cf14a1`; -3. Write the boot-nonce generator to device's nvram +3. Write the boot-nonce generator to device's nvram (latest jailbreaks'll (for iOS 11+) unlocking nvram after setting boot-nonce): * SSH into the device and run `nvram com.apple.System.boot-nonce=0xde3318d224cf14a1` to set the boot-nonce generator *0xde3318d224cf14a1*; * verify with `nvram -p` command ### Recommended methods to activate nonceEnabler patch -#### Method 1: ios-kern-utils (iOS 7.x-10.x) +#### Method 1: ios-kern-utils (iOS 7.x-10.x): 1. Install DEB-file of [ios-kern-utils](https://github.com/Siguza/ios-kern-utils/releases/) on device; 2. Run on the device `nvpatch com.apple.System.boot-nonce`. #### Method 2: Using special applications -Use utilities for setting boot-nonce generator — [PhœnixNonce](https://github.com/Siguza/PhoenixNonce) for iOS 9.x, [v0rtexnonce](https://github.com/arx8x/v0rtexnonce) for iOS 10.x, [nonceset1112](https://github.com/julioverne/NonceSet112) for iOS 11.0-11.1.2, [noncereboot1131UI](https://github.com/s0uthwest/noncereboot1131UI) for iOS 11.0-11.4b3, [NonceReboot12xx](https://github.com/ur0/NonceReboot12XX) for iOS 12.0-12.1.2. +Use utilities for setting boot-nonce generator: +1. [PhœnixNonce](https://github.com/Siguza/PhoenixNonce) for iOS 9.x; +2. [v0rtexnonce](https://github.com/arx8x/v0rtexnonce) for iOS 10.x; +3. [Nonceset1112](https://github.com/julioverne/NonceSet112) for iOS 11.0-11.1.2; +4. [noncereboot1131UI](https://github.com/s0uthwest/noncereboot1131UI) for iOS 11.0-11.4b3; +5. [NonceReboot12xx](https://github.com/ur0/NonceReboot12XX) for iOS 12.0-12.1.2. #### Method 3: Using jailbreak tools -Use jailbreak tools for setting boot-nonce generator - [backr00m](https://nito.tv) for tvOS 10.2-11.1, [Electra](https://coolstar.org/electra) for iOS 11.x, [unc0ver](https://github.com/pwn20wndstuff/Undecimus/releases) for iOS 11.0-12.1.2 and [Chimera](https://chimera.sh) for iOS 12.0-12.1.2. +Use jailbreak tools for setting boot-nonce generator: +1. [backr00m](https://nito.tv) or greeng0blin for tvOS 10.2-11.1; +2. [Electra and ElectraTV](https://coolstar.org/electra) for iOS and tvOS 11.x; +3. [unc0ver](https://github.com/pwn20wndstuff/Undecimus/releases) for iOS 11.0-12.1.2; +4. [Chimera and ChimeraTV](https://chimera.sh) for iOS 12.0-12.1.2 and tvOS 12.0-12.1.1. ### Activate tfp0 if jailbreak doesn't allow it -#### Method 1 (if jailbroken on 9.3.x) +#### Method 1 (if jailbroken on 9.2-9.3.x) * reboot; * reactivate jailbreak with [Luca Todesco](https://github.com/kpwn)'s [JailbreakMe](https://jbme.qwertyoruiop.com/); * done. @@ -115,9 +125,9 @@ Use jailbreak tools for setting boot-nonce generator - [backr00m](https://nito.t ## 2) Prometheus (64-bit device) - ApNonce collision method (Recovery mode); ### Requirements -- __iPhone 5s, iPad Air, iPad mini 2 (devices with A7 chip) on iOS 9.1 - 10.2;__ +- __iPhone 5s, iPad Air, iPad mini 2 (devices with A7 chip) on iOS 9.2 — 10.2 (10.3b1);__ - Jailbreak doesn't required; -- Signing tickets (.shsh, shsh2) with customly chosen ApNonce; +- Signing tickets (.shsh, .shsh2) with customly chosen ApNonce; - Ticket needs to have one of the ApNonces, which the device generates a lot; - __collisioned ApNonces available in file 'nonces.txt' in [TSSChecker](https://github.com/s0uthwest/tsschecker) project.__ @@ -132,7 +142,8 @@ one to speed up the process: `futurerestore -w -t t1.shsh -t t2.shsh -t t3.shsh ## 3) Prometheus (64-bit device) - ApNonce collision method (DFU mode); ### Requirements -- __Devices for A7 chip (iPhone 5s, iPad Air, iPad mini 2) and some devices with A8 chip (iPod touch [6th gen]) on all iOS firmwares;__ +- __Devices with A7 (iPhone 5s, iPad Air, iPad mini 2), A8 (iPhone 6 [+], iPad mini [2,3,4], iPod touch [6th generation]) and A8X (iPad Air 2) chips on all iOS firmwares;__ +- __Devices have been released after ~September, 2015;__ - Jailbreak doesn't required; - Signing tickets (.shsh, .shsh2) with customly chosen ApNonce; - Ticket needs to have one of the ApNonces, which the device generates a lot; @@ -141,9 +152,9 @@ one to speed up the process: `futurerestore -w -t t1.shsh -t t2.shsh -t t3.shsh ### How to use 1. Connect your device in DFU mode; -2. Use [irecovery](https://github.com/libimobiledevice/libirecovery) for check nonce booted with DFU; +2. Use [irecovery](https://github.com/s0uthwest/libirecovery) for checking ApNonce, which booted in DFU; 3. Extract iBSS/iBEC from target firmware for downgrade (unsigned); -4. Check DFU ApNonces with [irecovery](https://github.com/libimobiledevice/irecovery) with DFU booting. +4. Check DFU-collisioned ApNonces with [irecovery](https://github.com/s0uthwest/irecovery/releases), which booted in DFU. You can't automatically collision DFU ApNonces. __If ApNonce is not collisioned, "use hands" for DFU booting.__ @@ -153,7 +164,7 @@ one to speed up the process: `futurerestore -w -t t1.shsh -t t2.shsh -t t3.shsh `img4tool -s ticket.shsh -c iBSS.signed -p `; 6. Use [img4tool](https://github.com/s0uthwest/img4tool/releases) for sign iBEC: `img4tool -s ticket.shsh -c iBEC.signed -p `; -7. So, after signing we can boot into Recovery with [irecovery](https://github.com/libimobiledevice/irecovery): +7. So, after signing we can boot into Recovery with [irecovery](https://github.com/s0uthwest/libirecovery/releases): `irecovery -f iBSS.signed` - loading iBSS; @@ -166,19 +177,19 @@ one to speed up the process: `futurerestore -w -t t1.shsh -t t2.shsh -t t3.shsh ### Requirements - futurerestore compiled with [libipatcher](https://github.com/s0uthwest/libipatcher) ([Odysseus](https://dayt0n.com/articles/Odysseus) method support); -- Jailbreak or bootrom exploit (limera1n); +- Jailbreak or bootROM exploit (limera1n); - Firmware keys for the device/destination iOS must be public; - Signing tickets (.shsh, .shsh2) for the destination iOS (OTA blobs work too!); - _Odysseus bundle (You can use any successfully created bundle for this)._ ### How to use 1. Get device into kDFU/pwnDFU mode: - * Pre-iPhone 4s (limera1n devices): + * limera1n devices: * Enter pwnDFU mode with redsn0w or any other tool; - * iPhone 4s and later: + * Other 32-bit devices: * Jailbreak required; * Enter kDFU mode by loading a pwnediBSS from any existing Odysseus bundle. -2. Connect your device to computer in kDFU mode (or pwnDFU mode) +2. Connect your device to computer in kDFU / pwnDFU mode; 3. On the computer run `futurerestore --use-pwndfu -t ticket.shsh --latest-baseband ios.ipsw` --- From 7c6a46f4832df72beb8c7f1bee9565b2af82fab3 Mon Sep 17 00:00:00 2001 From: s0uthwest Date: Thu, 20 Jun 2019 07:21:23 -0700 Subject: [PATCH 62/69] Add instruction for fix cURL problems for macOS --- .gitignore | 6 ++---- ReadMe.md | 14 +++++++------- external/tsschecker | 2 +- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/.gitignore b/.gitignore index 6656a007a..32c8f62be 100644 --- a/.gitignore +++ b/.gitignore @@ -8,8 +8,7 @@ *.lo */.libs/* */.deps/* -Makefile -Makefile.in +Makefile* aclocal.m4 autom4te.cache compile @@ -22,6 +21,5 @@ ltmain.sh m4 missing */config.h.bak -*/futurerestore -*/futurerestore.exe +*/futurerestore* stamp-h1 diff --git a/ReadMe.md b/ReadMe.md index 8f2f2256f..8a68c0e15 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -23,10 +23,10 @@ __NOT recommended to use '-u' parameter, if you update jailbroken firmware!__ * ## External Libs Required: * [libzip](https://github.com/nih-at/libzip); - * [libfragmentzip](https://github.com/encounter/libfragmentzip); + * [libfragmentzip](https://github.com/s0uthwest/libfragmentzip); * [libplist](https://github.com/libimobiledevice/libplist); * [libirecovery](https://github.com/s0uthwest/libirecovery); - * [libimobiledevice](https://github.com/libimobiledevice/libimobiledevice); + * [libimobiledevice](https://github.com/s0uthwest/libimobiledevice); Optional: * [libipatcher](https://github.com/s0uthwest/libipatcher); @@ -59,9 +59,9 @@ You can do it [here](https://github.com/s0uthwest/futurerestore/issues). ## Compiling Simple use `bash autogen.sh && make` or use Xcode project. For installing use `make install`. -### Some about [cURL](https://github.com/curl/curl) for ubuntu -Follow [this guide](https://dev.to/jake/using-libcurl3-and-libcurl4-on-ubuntu-1804-bionic-184g) to use tsschecker on Ubuntu 18.04 (Bionic) as it requires libcurl3 which cannot co-exist with libcurl4 on this OS. - +### Some about [cURL](https://github.com/curl/curl) + * Linux: Follow [this guide](https://dev.to/jake/using-libcurl3-and-libcurl4-on-ubuntu-1804-bionic-184g) to use tsschecker on Ubuntu 18.04 (Bionic) as it requires libcurl3 which cannot coexist with libcurl4 on this OS. + * macOS: open file [Makefile.am](https://github.com/s0uthwest/futurerestore/blob/master/futurerestore/Makefile.am) and update line with LDADD: `futurerestore_LDADD = $(AM_LDFLAGS) libjssy.a /usr/lib/libcurl.4.dylib` --- ## 0) What futurerestore can do @@ -148,7 +148,7 @@ one to speed up the process: `futurerestore -w -t t1.shsh -t t2.shsh -t t3.shsh - Signing tickets (.shsh, .shsh2) with customly chosen ApNonce; - Ticket needs to have one of the ApNonces, which the device generates a lot; - __[img4tool](https://github.com/s0uthwest/img4tool) can't be used for Windows [problem with signing iBSS/iBEC], now it's TO-DO;__ -- __collisioned ApNonces available in file 'nonces.txt' in [TSSChecker](https://github.com/s0uthwest/TSSChecker) project.__ +- __collisioned ApNonces available in file 'nonces.txt' in [TSSChecker](https://github.com/s0uthwest/tsschecker) project.__ ### How to use 1. Connect your device in DFU mode; @@ -213,4 +213,4 @@ Creator of [original project](https://github.com/tihmstar/futurerestore) - [tihm ReadMe updated on: - 2019-06-01 + 2019-06-20 diff --git a/external/tsschecker b/external/tsschecker index afa757e5e..c0b554e83 160000 --- a/external/tsschecker +++ b/external/tsschecker @@ -1 +1 @@ -Subproject commit afa757e5e77ebdb95b553be4ca2e12d6910cc6d0 +Subproject commit c0b554e83f54d39d90cac9791160bf2ccb062aed From 33bd118a08491125828602c4e866ad75c2cf1047 Mon Sep 17 00:00:00 2001 From: s0uthwest Date: Thu, 20 Jun 2019 07:23:33 -0700 Subject: [PATCH 63/69] idevicerestore: update socket for compatibility with libusbmuxd --- external/idevicerestore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external/idevicerestore b/external/idevicerestore index b36339e2a..b6f9f084f 160000 --- a/external/idevicerestore +++ b/external/idevicerestore @@ -1 +1 @@ -Subproject commit b36339e2a44e8e56c26063b898c86bc6d724b62b +Subproject commit b6f9f084f5c4b27690a954462dcfeaebfb87b7f0 From c56032e5d892f30e861d6564df8a02e75d04b26a Mon Sep 17 00:00:00 2001 From: s0uthwest Date: Thu, 20 Jun 2019 07:30:53 -0700 Subject: [PATCH 64/69] Enable codesigning for Xcode 11 support --- external/img4tool | 2 +- futurerestore.xcodeproj/project.pbxproj | 21 ++++++++++++++------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/external/img4tool b/external/img4tool index 9dc1f0887..7b9c735da 160000 --- a/external/img4tool +++ b/external/img4tool @@ -1 +1 @@ -Subproject commit 9dc1f08872e1f102a11cd69118448328a516851e +Subproject commit 7b9c735da4a5ece97eceed2d4cc45710cf09c6a9 diff --git a/futurerestore.xcodeproj/project.pbxproj b/futurerestore.xcodeproj/project.pbxproj index cab28712a..c1e38583c 100644 --- a/futurerestore.xcodeproj/project.pbxproj +++ b/futurerestore.xcodeproj/project.pbxproj @@ -380,11 +380,12 @@ 8785873B1D89CFDC008689F0 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 1010; + LastUpgradeCheck = 1100; ORGANIZATIONNAME = tihmstar; TargetAttributes = { 878587421D89CFDC008689F0 = { CreatedOnToolsVersion = 7.3.1; + ProvisioningStyle = Automatic; }; }; }; @@ -393,8 +394,6 @@ developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( - Base, - en, ); mainGroup = 8785873A1D89CFDC008689F0; productRefGroup = 878587441D89CFDC008689F0 /* Products */; @@ -539,7 +538,7 @@ PRODUCT_BUNDLE_IDENTIFIER = net.tihmstar.futurerestore; PRODUCT_NAME = futurerestore; SDKROOT = macosx; - USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/external/tsschecker/external/jssy/jssy"; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/external/tsschecker/external/jssy/jssy $(SRCROOT)/external"; }; name = Debug; }; @@ -600,7 +599,7 @@ PRODUCT_BUNDLE_IDENTIFIER = net.tihmstar.futurerestore; PRODUCT_NAME = futurerestore; SDKROOT = macosx; - USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/external/tsschecker/external/jssy/jssy"; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/external/tsschecker/external/jssy/jssy $(SRCROOT)/external"; }; name = Release; }; @@ -608,6 +607,9 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = ""; HEADER_SEARCH_PATHS = ( /usr/local/include, /opt/local/include, @@ -617,11 +619,12 @@ /usr/local/lib, /usr/lib, "$(SDKROOT)/usr/lib/system", - "$(PROJECT_DIR)", ); + MACOSX_DEPLOYMENT_TARGET = 10.12; OTHER_CFLAGS = "-DHAVE_LIBIPATCHER"; PRODUCT_BUNDLE_IDENTIFIER = net.tihmstar.futurerestore; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/external/tsschecker/external/jssy/jssy $(SRCROOT)/external"; }; name = Debug; @@ -630,6 +633,9 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = ""; HEADER_SEARCH_PATHS = ( /usr/local/include, /opt/local/include, @@ -639,11 +645,12 @@ /usr/local/lib, /usr/lib, "$(SDKROOT)/usr/lib/system", - "$(PROJECT_DIR)", ); + MACOSX_DEPLOYMENT_TARGET = 10.12; OTHER_CFLAGS = "-DHAVE_LIBIPATCHER"; PRODUCT_BUNDLE_IDENTIFIER = net.tihmstar.futurerestore; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/external/tsschecker/external/jssy/jssy $(SRCROOT)/external"; }; name = Release; From 31ea6d6d181384b04c7540be000e031e02b851e7 Mon Sep 17 00:00:00 2001 From: s0uthwest Date: Thu, 20 Jun 2019 08:33:33 -0700 Subject: [PATCH 65/69] img4tool: add Windows support Co-Authored-By: tihmstar Co-Authored-By: xybp888 <8657156@qq.com> --- external/img4tool | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external/img4tool b/external/img4tool index 7b9c735da..dd9b385e6 160000 --- a/external/img4tool +++ b/external/img4tool @@ -1 +1 @@ -Subproject commit 7b9c735da4a5ece97eceed2d4cc45710cf09c6a9 +Subproject commit dd9b385e6954b8d12021fd0c56e53d5ba760b80a From 81b98e0425e17250cc83d5badaf9a8cc6399f481 Mon Sep 17 00:00:00 2001 From: s0uthwest Date: Tue, 25 Jun 2019 08:25:18 -0700 Subject: [PATCH 66/69] idevicerestore: handle new timeout error conditions --- .gitignore | 3 - configure.ac | 3 +- external/idevicerestore | 2 +- futurerestore.xcodeproj/project.pbxproj | 2 +- futurerestore/config.h | 4 +- futurerestore/futurerestore.cpp | 238 +++++++++--------------- futurerestore/futurerestore.hpp | 7 +- futurerestore/main.cpp | 8 +- 8 files changed, 106 insertions(+), 161 deletions(-) diff --git a/.gitignore b/.gitignore index 32c8f62be..126de11f0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,3 @@ -*.patch -*.diff -*.swp *.DS_Store *.a *.o diff --git a/configure.ac b/configure.ac index e4ba21e37..68e5e62df 100644 --- a/configure.ac +++ b/configure.ac @@ -28,8 +28,9 @@ AC_CONFIG_MACRO_DIRS([m4]) AC_CONFIG_SUBDIRS(external/idevicerestore external/img4tool external/tsschecker) AC_CONFIG_SRCDIR([futurerestore]) +# Check for libraries AC_SEARCH_LIBS([pthread_create], [pthread]) -PKG_CHECK_MODULES(libplist, libplist >= 1.12) +PKG_CHECK_MODULES(libplist, libplist >= 2.0.0) PKG_CHECK_MODULES(libzip, libzip >= 0.10) PKG_CHECK_MODULES(libimobiledevice, libimobiledevice-1.0 >= 1.2.1) PKG_CHECK_MODULES(libfragmentzip, libfragmentzip >= 1.0) diff --git a/external/idevicerestore b/external/idevicerestore index b6f9f084f..b10634c81 160000 --- a/external/idevicerestore +++ b/external/idevicerestore @@ -1 +1 @@ -Subproject commit b6f9f084f5c4b27690a954462dcfeaebfb87b7f0 +Subproject commit b10634c81b47bc6842538358e889063e9cbcdbd4 diff --git a/futurerestore.xcodeproj/project.pbxproj b/futurerestore.xcodeproj/project.pbxproj index c1e38583c..2532ed9ce 100644 --- a/futurerestore.xcodeproj/project.pbxproj +++ b/futurerestore.xcodeproj/project.pbxproj @@ -422,7 +422,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "sed -i '.bak' \"s/.*define VERSION_COUNT_FUTURERESTORE.*/#define VERSION_COUNT_FUTURERESTORE \\\"$(git rev-list --count HEAD)\\\"/\" ./futurerestore/config.h 2>/dev/null || sed -i \"s/.*VERSION_COUNT_FUTURERESTORE.*/#define VERSION_COUNT_FUTURERESTORE \\\"$(git rev-list --count HEAD)\\\"/\" ./futurerestore/config.h 2>/dev/null\nsed -i '.bak' \"s/.*define VERSION_SHA_FUTURERESTORE.*/#define VERSION_SHA_FUTURERESTORE \\\"$(git rev-parse HEAD)\\\"/\" ./futurerestore/config.h 2>/dev/null || sed -i \"s/.*VERSION_SHA_FUTURERESTORE.*/#define VERSION_SHA_FUTURERESTORE \\\"$(git rev-parse HEAD)\\\"/\" ./futurerestore/config.h 2>/dev/null\n\n"; + shellScript = "sed -i '.bak' \"s/.*define VERSION_COUNT_FUTURERESTORE.*/#define VERSION_COUNT_FUTURERESTORE \\\"$(git rev-list --count HEAD)\\\"/\" ./futurerestore/config.h 2>/dev/null || sed -i \"s/.*VERSION_COUNT_FUTURERESTORE.*/#define VERSION_COUNT_FUTURERESTORE \\\"$(git rev-list --count HEAD)\\\"/\" ./futurerestore/config.h 2>/dev/null\nsed -i '.bak' \"s/.*define VERSION_SHA_FUTURERESTORE.*/#define VERSION_SHA_FUTURERESTORE \\\"$(git rev-parse HEAD)\\\"/\" ./futurerestore/config.h 2>/dev/null || sed -i \"s/.*VERSION_SHA_FUTURERESTORE.*/#define VERSION_SHA_FUTURERESTORE \\\"$(git rev-parse HEAD)\\\"/\" ./futurerestore/config.h 2>/dev/null\n"; }; /* End PBXShellScriptBuildPhase section */ diff --git a/futurerestore/config.h b/futurerestore/config.h index 8423f2727..acba9d8ad 100644 --- a/futurerestore/config.h +++ b/futurerestore/config.h @@ -20,7 +20,7 @@ #undef VERSION_SHA #undef VERSION_COUNT -#define VERSION_COUNT_FUTURERESTORE "undefined version number" -#define VERSION_SHA_FUTURERESTORE "undefined version commit" +#define VERSION_COUNT_FUTURERESTORE "undefined number" +#define VERSION_SHA_FUTURERESTORE "undefined commit" #endif /* config_h */ diff --git a/futurerestore/futurerestore.cpp b/futurerestore/futurerestore.cpp index 221017415..353aa20cd 100644 --- a/futurerestore/futurerestore.cpp +++ b/futurerestore/futurerestore.cpp @@ -19,6 +19,7 @@ #include "futurerestore.hpp" extern "C"{ +#include #include "common.h" #include "../external/img4tool/img4tool/img4.h" #include "img4tool.h" @@ -29,7 +30,6 @@ extern "C"{ #include "locking.h" #include "restore.h" #include "tsschecker.h" -#include } //(re)define __mkdir @@ -93,7 +93,7 @@ bool futurerestore::init(){ info("[INFO] 32-bit device detected\n"); }else{ info("[INFO] 64-bit device detected\n"); - if (_isPwnDfu) reterror(-90, "isPwnDfu is only allowed for 32-bit devices\n"); + if (_isPwnDfu) reterror(-90, "pwned DFU is only allowed for 32-bit devices\n"); } return _didInit; } @@ -101,9 +101,7 @@ bool futurerestore::init(){ uint64_t futurerestore::getDeviceEcid(){ if (!_didInit) reterror(-1, "did not init\n"); uint64_t ecid; - get_ecid(_client, &ecid); - return ecid; } @@ -132,7 +130,7 @@ void futurerestore::putDeviceIntoRecovery(){ #ifdef HAVE_LIBIPATCHER if (_isPwnDfu) - reterror(-501, "isPwnDfu enabled, but device was found in normal mode\n"); + reterror(-501, "pwned DFU enabled, but device was found in normal mode\n"); #endif info("Entering recovery mode...\n"); @@ -142,23 +140,24 @@ void futurerestore::putDeviceIntoRecovery(){ }else if (_client->mode->index == MODE_RECOVERY){ info("Device already in Recovery mode\n"); }else if (_client->mode->index == MODE_DFU && _isPwnDfu && + #ifdef HAVE_LIBIPATCHER true #else false #endif + ){ - info("requesting to get into pwnRecovery later\n"); + info("requesting to get into pwned DFU later\n"); }else if (!_client->image4supported){ - info("32-bit device in DFU mode found, assuming user wants to use iOS 9 re-restore bug. Not failing here\n"); + info("32-bit device in DFU mode found, assuming user wants to use iOS 9.x re-restoring. Not failing here\n"); }else{ reterror(-3, "unsupported device mode, please put device in recovery mode or normal mode\n"); } - //only needs to be freed manually when function did't throw exception - safeFree(_client->udid); + safeFree(_client->udid); // only needs to be freed manually when function did't throw exception - //these get also freed by destructor + // these get also freed by destructor normal_client_free(_client); dfu_client_free(_client); recovery_client_free(_client); @@ -188,11 +187,12 @@ void futurerestore::exitRecovery() { plist_t futurerestore::nonceMatchesApTickets(){ if (!_didInit) reterror(-1, "did not init\n"); + if (getDeviceMode(true) != MODE_RECOVERY){ if (getDeviceMode(false) != MODE_DFU || *_client->version != '9') - reterror(-10, "Device not in recovery mode, can't check ApNonce\n"); + reterror(-10, "Device isn't in recovery mode, can't check ApNonce\n"); else - _rerestoreiOS9 = (info("Detected iOS 9 re-restore, proceeding in DFU mode\n"),true); + _rerestoreiOS9 = (info("Detected iOS 9.x re-restoring, proceeding in DFU mode\n"),true); } unsigned char* realnonce; @@ -201,7 +201,6 @@ plist_t futurerestore::nonceMatchesApTickets(){ info("Skipping ApNonce check\n"); }else{ recovery_get_ap_nonce(_client, &realnonce, &realNonceSize); - info("Got ApNonce from device: "); int i = 0; for (i = 0; i < realNonceSize; i++) { @@ -211,7 +210,6 @@ plist_t futurerestore::nonceMatchesApTickets(){ } vectornonces; - if (_client->image4supported){ for (int i=0; i< _im4ms.size(); i++){ if (memcmp(realnonce, (unsigned const char*)getBNCHFromIM4M(_im4ms[i],NULL), realNonceSize) == 0) return _aptickets[i]; @@ -228,8 +226,7 @@ plist_t futurerestore::nonceMatchesApTickets(){ ) ) ) - //either ApNonce needs to match or using re-restore bug in iOS 9 - return _aptickets[i]; + return _aptickets[i]; //either ApNonce needs to match or using re-restore bug in iOS 9.x } } @@ -238,14 +235,13 @@ plist_t futurerestore::nonceMatchesApTickets(){ const char *futurerestore::nonceMatchesIM4Ms(){ if (!_didInit) reterror(-1, "did not init\n"); - if (getDeviceMode(true) != MODE_RECOVERY) reterror(-10, "Device not in recovery mode, can't check ApNonce\n"); + if (getDeviceMode(true) != MODE_RECOVERY) reterror(-10, "Device isn't in recovery mode, can't check ApNonce\n"); unsigned char* realnonce; int realNonceSize = 0; recovery_get_ap_nonce(_client, &realnonce, &realNonceSize); vectornonces; - if (_client->image4supported) { for (int i=0; i< _im4ms.size(); i++){ if (memcmp(realnonce, (unsigned const char*)getBNCHFromIM4M(_im4ms[i],NULL), realNonceSize) == 0) return _im4ms[i]; @@ -262,7 +258,6 @@ const char *futurerestore::nonceMatchesIM4Ms(){ void futurerestore::waitForNonce(vectornonces, size_t nonceSize){ if (!_didInit) reterror(-1, "did not init\n"); setAutoboot(false); - unsigned char* realnonce; int realNonceSize = 0; @@ -282,7 +277,7 @@ void futurerestore::waitForNonce(vectornonces, size_t nonceSize){ usleep(1*USEC_PER_SEC); } while (getDeviceMode(true) != MODE_RECOVERY) usleep(USEC_PER_SEC*0.5); - if (recovery_client_new(_client)) reterror(-4,"Could not connect to device in recovery mode.\n"); + if (recovery_client_new(_client)) reterror(-4,"Couldn't connect to device in recovery mode.\n"); recovery_get_ap_nonce(_client, &realnonce, &realNonceSize); info("Got ApNonce from device: "); @@ -296,7 +291,6 @@ void futurerestore::waitForNonce(vectornonces, size_t nonceSize){ } } while (_foundnonce == -1); info("Device has requested ApNonce now\n"); - setAutoboot(true); } @@ -306,8 +300,7 @@ void futurerestore::waitForNonce(){ vectornonces; if (!_client->image4supported) - reterror(-77, "Error: ApNonce collisions is not supported on 32-bit devices\n"); - + reterror(-77, "Error: ApNonce collisions isn't supported on 32-bit devices\n"); for (auto im4m : _im4ms){ nonces.push_back(getBNCHFromIM4M(im4m,&nonceSize)); } @@ -369,11 +362,11 @@ void futurerestore::loadAPTickets(const vector &apticketPaths){ plist_get_data_val(ticket, &im4m, &im4msize); if (!im4msize) - reterror(-38, "Error: failed to load ticket %s\n",apticketPath); + reterror(-38, "Error: failed to load signing ticket %s\n",apticketPath); _im4ms.push_back(im4m); _aptickets.push_back(apticket); - printf("reading ticket %s done\n",apticketPath); + printf("reading signing ticket %s is done\n",apticketPath); } } @@ -387,7 +380,7 @@ uint64_t futurerestore::getBasebandGoldCertIDFromDevice(){ plist_t node; node = plist_dict_get_item(_client->preflight_info, "CertID"); if (!node || plist_get_node_type(node) != PLIST_UINT) { - error("Unable to find required CertID in in device preflight info\n"); + error("Unable to find required CertID in device preflight info\n"); return 0; } uint64_t val = 0; @@ -451,12 +444,13 @@ void futurerestore::enterPwnRecovery(plist_t build_identity, string bootargs){ #ifndef HAVE_LIBIPATCHER reterror(-404, "compiled without libipatcher"); #else + int mode = 0; libipatcher::fw_key iBSSKeys; libipatcher::fw_key iBECKeys; if (dfu_client_new(_client) < 0) - reterror(-91,"Unable to connect to DFU device\n"); + reterror(-91,"Unable to connect to DFU mode\n"); irecv_get_mode(_client->dfu->client, &mode); try { @@ -475,13 +469,13 @@ void futurerestore::enterPwnRecovery(plist_t build_identity, string bootargs){ bool modeIsRecovery = false; if (mode != IRECV_K_DFU_MODE) { - info("NOTE: device is not in DFU mode, assuming kDFU mode.\n"); + info("NOTE: device isn't in DFU mode, assuming pwned DFU mode.\n"); for (int i=IRECV_K_RECOVERY_MODE_1; i<=IRECV_K_RECOVERY_MODE_4; i++) { if (mode == i) modeIsRecovery = true; } if (!modeIsRecovery) - reterror(-505, "device not in recovery mode\n"); + reterror(-505, "device isn't in recovery mode\n"); }else{ info("Sending %s (%lu bytes)...\n", "iBSS", iBSS.second); // FIXME: Did I do this right???? @@ -501,7 +495,6 @@ void futurerestore::enterPwnRecovery(plist_t build_identity, string bootargs){ reterror(-92,"ERROR: set configuration failed\n"); } - /* send iBEC */ info("Sending %s (%lu bytes)...\n", "iBEC", iBEC.second); irecv_error_t err = irecv_send_buffer(_client->dfu->client, (unsigned char*)(char*)iBEC.first, (unsigned long)iBEC.second, 1); if (err != IRECV_E_SUCCESS) { @@ -539,6 +532,7 @@ void get_custom_component(struct idevicerestore_client_t* client, plist_t build_ #ifndef HAVE_LIBIPATCHER reterror(-404, "compiled without libipatcher"); #else + try { auto comp = getIPSWComponent(client, build_identity, component); comp = move(libipatcher::decryptFile3((char*)comp.first, comp.second, libipatcher::getFirmwareKey(client->device->product_type, client->build, component))); @@ -561,11 +555,9 @@ int futurerestore::doRestore(const char *ipsw){ } \ throw int(code); \ } - + // some memory might not get freed if this function throws an exception, but you probably don't want to catch that anyway. int err = 0; bool canExitRecovery = false; - //some memory might not get freed if this function throws an exception, but you probably don't want to catch that anyway. - struct idevicerestore_client_t* client = _client; int unused; int result = 0; @@ -574,77 +566,66 @@ int futurerestore::doRestore(const char *ipsw){ plist_t buildmanifest = NULL; plist_t build_identity = NULL; plist_t sep_build_identity = NULL; - client->ipsw = strdup(ipsw); + if (!_isUpdateInstall) client->flags |= FLAG_ERASE; else if (_enterPwnRecoveryRequested){ - reterror(577, "ERROR: Update install is not supported in pwnDFU mode\n"); + reterror(577, "ERROR: Update install isn't supported in pwned DFU mode\n"); } getDeviceMode(true); info("Found device in %s mode\n", client->mode->string); if (client->mode->index != MODE_RECOVERY && client->mode->index != MODE_DFU && !_enterPwnRecoveryRequested) - reterror(-6, "device not in recovery mode\n"); - // discover the device type + reterror(-6, "device isn't in recovery mode\n"); client->device = get_irecv_device(client); if (client->device == NULL) { reterror(-2,"ERROR: Unable to discover device type\n"); } info("Identified device as %s, %s\n", client->device->hardware_model, client->device->product_type); - canExitRecovery = true; - // verify if ipsw file exists + // verify if iPSW file exists if (access(client->ipsw, F_OK) < 0) { - error("ERROR: Firmware file %s does not exist.\n", client->ipsw); + error("ERROR: Firmware file %s doesn't exist.\n", client->ipsw); return -1; } - info("Extracting BuildManifest from IPSW\n"); + info("Extracting BuildManifest from iPSW\n"); if (ipsw_extract_build_manifest(client->ipsw, &buildmanifest, &unused) < 0) { reterror(-3,"ERROR: Unable to extract BuildManifest from %s. Firmware file might be corrupt.\n", client->ipsw); } - /* check if device type is supported by the given build manifest */ if (build_manifest_check_compatibility(buildmanifest, client->device->product_type) < 0) { - reterror(-4,"ERROR: Could not make sure this firmware is suitable for the current device. Refusing to continue.\n"); + reterror(-4,"ERROR: Couldn't make sure this firmware is suitable for the current device. Refusing to continue.\n"); } - /* print iOS information from the manifest */ build_manifest_get_version_information(buildmanifest, client); - - info("Product Version: %s\n", client->version); - info("Product Build: %s Major: %d\n", client->build, client->build_major); - + info("Product version: %s\n", client->version); + info("Product build: %s Major: %d\n", client->build, client->build_major); client->image4supported = is_image4_supported(client); - info("Device supports Image4: %s\n", (client->image4supported) ? "true" : "false"); + info("Device supports IMG4: %s\n", (client->image4supported) ? "true" : "false"); - if (_enterPwnRecoveryRequested) //we are in pwnDFU, so we don't need to check nonces + if (_enterPwnRecoveryRequested) // we're in pwned DFU, so we don't need to check nonces client->tss = _aptickets.at(0); else if (!(client->tss = nonceMatchesApTickets())) - reterror(-20, "Devicen ApNonce does not match APTicket nonce\n"); + reterror(-20, "Device ApNonce doesn't match APTicket nonce\n"); plist_dict_remove_item(client->tss, "BBTicket"); plist_dict_remove_item(client->tss, "BasebandFirmware"); if (!(build_identity = getBuildidentityWithBoardconfig(buildmanifest, client->device->hardware_model, _isUpdateInstall))) - reterror(-5,"ERROR: Unable to find any build identities for IPSW\n"); - + reterror(-5,"ERROR: Unable to find any build identities for iPSW\n"); if (_client->image4supported && !(sep_build_identity = getBuildidentityWithBoardconfig(_sepbuildmanifest, client->device->hardware_model, _isUpdateInstall))) reterror(-5,"ERROR: Unable to find any build identities for SEP\n"); - - //this is the buildidentity used for restore - plist_t manifest = plist_dict_get_item(build_identity, "Manifest"); + plist_t manifest = plist_dict_get_item(build_identity, "Manifest"); // this is the buildidentity used for restore printf("checking APTicket to be valid for this restore...\n"); - //if we are in pwnDFU, just use first apticket. no need to check nonces - const char * im4m = (_enterPwnRecoveryRequested || _rerestoreiOS9) ? _im4ms.at(0) : nonceMatchesIM4Ms(); + const char * im4m = (_enterPwnRecoveryRequested || _rerestoreiOS9) ? _im4ms.at(0) : nonceMatchesIM4Ms(); // NOTE: if we're in pwned DFU, just use first ApTicket. No need to check nonces. uint64_t deviceEcid = getDeviceEcid(); uint64_t im4mEcid = (_client->image4supported) ? getEcidFromIM4M(im4m) : getEcidFromSCAB(im4m); if (!im4mEcid) reterror(-46, "Failed to read ECID from APTicket\n"); - if (im4mEcid != deviceEcid) { - error("ECID inside APTicket does not match device ECID\n"); + error("ECID inside APTicket doesn't match device ECID\n"); printf("APTicket is valid for %16llu (dec) but device is %16llu (dec)\n",im4mEcid,deviceEcid); reterror(-45, "APTicket can't be used for restoring this device\n"); }else @@ -653,45 +634,42 @@ int futurerestore::doRestore(const char *ipsw){ if (_client->image4supported) { printf("checking APTicket to be valid for this restore...\n"); const char * im4m = nonceMatchesIM4Ms(); - uint64_t deviceEcid = getDeviceEcid(); uint64_t im4mEcid = (_client->image4supported) ? getEcidFromIM4M(im4m) : getEcidFromSCAB(im4m); if (!im4mEcid) reterror(-46, "Failed to read ECID from APTicket\n"); - if (im4mEcid != deviceEcid) { - error("ECID inside APTicket does not match device ECID\n"); + error("ECID inside APTicket doesn't match device ECID\n"); printf("APTicket is valid for %16llu (dec) but device is %16llu (dec)\n",im4mEcid,deviceEcid); reterror(-45, "APTicket can't be used for restoring this device\n"); }else printf("Verified ECID in APTicket matches device ECID\n"); plist_t ticketIdentity = getBuildIdentityForIM4M(im4m, buildmanifest); - //TO-DO: make this nicer! For now a simple pointercompare should be fine, because both plist_t should point into the same buildidentity inside the buildmanifest + /* TO-DO: make this nicer! For now a simple pointercompare should be fine, because both plist_t should point into the same buildidentity inside the buildmanifest */ if (ticketIdentity != build_identity ){ - error("BuildIdentity selected for restore does not match APTicket\n\n"); + error("BuildIdentity selected for restore doesn't match APTicket\n\n"); printf("BuildIdentity selected for restore:\n"); printGeneralBuildIdentityInformation(build_identity); printf("\nBuildIdentiy valid for the APTicket:\n"); if (ticketIdentity) printGeneralBuildIdentityInformation(ticketIdentity),putchar('\n'); else{ - printf("IM4M is not valid for any restore within the Buildmanifest\n"); + printf("IM4M isn't valid for any restore with this BuildManifest\n"); printf("This APTicket can't be used for restoring this firmware\n"); } reterror(-44, "APTicket can't be used for this restore\n"); }else{ if (verifyIM4MSignature(im4m)){ - printf("IM4M signature is not valid!\n"); + printf("IM4M signature isn't valid!\n"); reterror(-44, "APTicket can't be used for this restore\n"); } printf("Verified APTicket to be valid for this restore\n"); } }else if (_enterPwnRecoveryRequested){ - info("[WARNING] skipping ramdisk hash check, since device is in pwnDFU according to user\n"); - + info("[WARNING] skipping ramdisk hash check, since device is in pwned DFU according to user\n"); }else{ - info("[WARNING] full buildidentity check is not implemented, only comparing ramdisk hash.\n"); + info("[WARNING] full buildidentity check isn't implemented, only comparing ramdisk hash.\n"); size_t tickethashSize = 0; const char *tickethash = getRamdiskHashFromSCAB(im4m, &tickethashSize); uint64_t manifestDigestSize = 0; @@ -699,7 +677,6 @@ int futurerestore::doRestore(const char *ipsw){ plist_t restoreRamdisk = plist_dict_get_item(manifest, "RestoreRamDisk"); plist_t digest = plist_dict_get_item(restoreRamdisk, "Digest"); - plist_get_data_val(digest, &manifestDigest, &manifestDigestSize); if (tickethashSize == manifestDigestSize && memcmp(tickethash, manifestDigest, tickethashSize) == 0){ @@ -707,7 +684,7 @@ int futurerestore::doRestore(const char *ipsw){ free(manifestDigest); }else{ free(manifestDigest); - printf("APTicket ramdisk hash does not match the ramdisk we are trying to boot. Are you using correct install type (Update/Erase)?\n"); + printf("APTicket ramdisk hash doesn't match the ramdisk we're trying to boot. Are you using correct install type (Update/Erase)?\n"); reterror(-44, "APTicket can't be used for this restore\n"); } } @@ -715,24 +692,23 @@ int futurerestore::doRestore(const char *ipsw){ if (_basebandbuildmanifest){ if (!(client->basebandBuildIdentity = getBuildidentityWithBoardconfig(_basebandbuildmanifest, client->device->hardware_model, _isUpdateInstall))){ if (!(client->basebandBuildIdentity = getBuildidentityWithBoardconfig(_basebandbuildmanifest, client->device->hardware_model, !_isUpdateInstall))) { - reterror(-5, "ERROR: Unable to find any build identities for Baseband\n"); + reterror(-5, "ERROR: Unable to find any buildidentities for Baseband\n"); } else { info("[WARNING] Unable to find Baseband buildidentities for restore type %s, using fallback %s\n", (_isUpdateInstall) ? "Update" : "Erase", (!_isUpdateInstall) ? "Update" : "Erase"); } } - - client->bbfwtmp = (char*)_basebandPath; + client->bbfwtmp = (char*)_basebandPath; plist_t bb_manifest = plist_dict_get_item(client->basebandBuildIdentity, "Manifest"); plist_t bb_baseband = plist_copy(plist_dict_get_item(bb_manifest, "BasebandFirmware")); plist_dict_set_item(manifest, "BasebandFirmware", bb_baseband); if (!_client->basebandBuildIdentity) - reterror(-55, "BasebandBuildIdentity not loaded, refusing to continue"); - }else{ - warning("WARNING: we don't have a basebandbuildmanifest, not flashing baseband!\n"); - } + reterror(-55, "BasebandBuildIdentity isn't loaded, refusing to continue"); + }else{ + warning("WARNING: we don't have a basebandbuildmanifest, not flashing baseband!\n"); + } if (_client->image4supported) { plist_t sep_manifest = plist_dict_get_item(sep_build_identity, "Manifest"); @@ -747,19 +723,17 @@ int futurerestore::doRestore(const char *ipsw){ reterror(-66, "ERROR: can't find SEP digest\n"); plist_get_data_val(digest, reinterpret_cast(&sephash), &sephashlen); - if (sephashlen == 20) SHA1((unsigned char*)_client->sepfwdata, (unsigned int)_client->sepfwdatasize, genHash); else SHA384((unsigned char*)_client->sepfwdata, (unsigned int)_client->sepfwdatasize, genHash); if (memcmp(genHash, sephash, sephashlen)) - reterror(-67, "ERROR: SEP does not match SEPManifest\n"); + reterror(-67, "ERROR: SEP doesn't match SEPManifest\n"); } - /* print information about current build identity */ build_identity_print_information(build_identity); - //check for enterpwnrecovery, because we could be in DFU mode + // check for pwned DFU, because we could be in DFU mode if (_enterPwnRecoveryRequested){ if (getDeviceMode(true) != MODE_DFU) reterror(-6, "unexpected device mode\n"); @@ -840,10 +814,10 @@ int futurerestore::doRestore(const char *ipsw){ } remove(lockfn); - // Extract filesystem from IPSW - info("Extracting filesystem from IPSW\n"); + // Extract filesystem from iPSW + info("Extracting filesystem from iPSW\n"); if (ipsw_extract_to_file_with_progress(client->ipsw, fsname, filesystem, 1) < 0) { - reterror(-7,"ERROR: Unable to extract filesystem from IPSW\n"); + reterror(-7,"ERROR: Unable to extract filesystem from iPSW\n"); } if (strstr(filesystem, ".extract")) { @@ -868,7 +842,6 @@ int futurerestore::doRestore(const char *ipsw){ sleep(2); dfu_client_new(client); - /* send iBEC */ if (dfu_send_component(client, build_identity, "iBEC") < 0) { error("ERROR: Unable to send iBEC to device\n"); irecv_close(client->dfu->client); @@ -878,7 +851,6 @@ int futurerestore::doRestore(const char *ipsw){ }else{ if ((client->build_major > 8)) { if (!client->image4supported) { - /* send ApTicket */ if (recovery_send_ticket(client) < 0) { error("WARNING: Unable to send APTicket\n"); } @@ -886,11 +858,10 @@ int futurerestore::doRestore(const char *ipsw){ } } - if (_enterPwnRecoveryRequested){ //if pwnrecovery send all components decrypted, unless we're dealing with iOS 10 + if (_enterPwnRecoveryRequested){ // if pwned DFU send all components decrypted, unless we're dealing with iOS 10 if (strncmp(client->version, "10.", 3)) client->recovery_custom_component_function = get_custom_component; }else if (!_rerestoreiOS9){ - /* now we load the iBEC */ if (recovery_send_ibec(client, build_identity) < 0) { reterror(-8,"ERROR: Unable to send iBEC\n"); } @@ -910,12 +881,10 @@ int futurerestore::doRestore(const char *ipsw){ //do magic if (_client->image4supported) get_sep_nonce(client, &client->sepnonce, &client->sepnonce_size); get_ap_nonce(client, &client->nonce, &client->nonce_size); - get_ecid(client, &client->ecid); - if (client->mode->index == MODE_RECOVERY) { if (client->srnm == NULL) { - reterror(-9,"ERROR: could not retrieve device serial number. Can't continue.\n"); + reterror(-9,"ERROR: couldn't retrieve device serial number. Can't continue.\n"); } if (irecv_send_command(client->recovery->client, "bgcolor 0 255 0") != IRECV_E_SUCCESS) { error("ERROR: Unable to set bgcolor\n"); @@ -960,22 +929,20 @@ int futurerestore::doRestore(const char *ipsw){ } int futurerestore::doJustBoot(const char *ipsw, string bootargs){ - int err = 0; //some memory might not get freed if this function throws an exception, but you probably don't want to catch that anyway. - + int err = 0; struct idevicerestore_client_t* client = _client; int unused; int result = 0; plist_t buildmanifest = NULL; plist_t build_identity = NULL; - client->ipsw = strdup(ipsw); getDeviceMode(true); info("Found device in %s mode\n", client->mode->string); if (!(client->mode->index == MODE_DFU || client->mode->index == MODE_RECOVERY) || !_enterPwnRecoveryRequested) - reterror(-6, "device not in DFU/Recovery mode\n"); + reterror(-6, "device isn't in DFU/Recovery mode\n"); // discover the device type client->device = get_irecv_device(client); if (client->device == NULL) { @@ -983,37 +950,31 @@ int futurerestore::doJustBoot(const char *ipsw, string bootargs){ } info("Identified device as %s, %s\n", client->device->hardware_model, client->device->product_type); - // verify if ipsw file exists + // verify if iPSW file exists if (access(client->ipsw, F_OK) < 0) { - error("ERROR: Firmware file %s does not exist.\n", client->ipsw); + error("ERROR: Firmware file %s doesn't exist.\n", client->ipsw); return -1; } - info("Extracting BuildManifest from IPSW\n"); + info("Extracting BuildManifest from iPSW\n"); if (ipsw_extract_build_manifest(client->ipsw, &buildmanifest, &unused) < 0) { reterror(-3,"ERROR: Unable to extract BuildManifest from %s. Firmware file might be corrupt.\n", client->ipsw); } - /* check if device type is supported by the given build manifest */ if (build_manifest_check_compatibility(buildmanifest, client->device->product_type) < 0) { - reterror(-4,"ERROR: Could not make sure this firmware is suitable for the current device. Refusing to continue.\n"); + reterror(-4,"ERROR: Couldn't make sure this firmware is suitable for the current device. Refusing to continue.\n"); } - /* print iOS information from the manifest */ build_manifest_get_version_information(buildmanifest, client); - - info("Product Version: %s\n", client->version); - info("Product Build: %s Major: %d\n", client->build, client->build_major); - + info("Product version: %s\n", client->version); + info("Product build: %s Major: %d\n", client->build, client->build_major); client->image4supported = is_image4_supported(client); - info("Device supports Image4: %s\n", (client->image4supported) ? "true" : "false"); + info("Device supports IMG4: %s\n", (client->image4supported) ? "true" : "false"); if (!(build_identity = getBuildidentityWithBoardconfig(buildmanifest, client->device->hardware_model, 0))) - reterror(-5,"ERROR: Unable to find any build identities for IPSW\n"); - - /* print information about current build identity */ + reterror(-5,"ERROR: Unable to find any build identities for iPSW\n"); build_identity_print_information(build_identity); - //check for kDFU, because we could be in DFU mode + // check for pwned DFU, because we could be in DFU mode if (!_enterPwnRecoveryRequested) - reterror(-6, "Device isn't in kDFU mode\n"); + reterror(-6, "Device isn't in pwned DFU mode\n"); if (getDeviceMode(true) != MODE_DFU && getDeviceMode(false) != MODE_RECOVERY) reterror(-6, "unexpected device mode\n"); @@ -1023,25 +984,22 @@ int futurerestore::doJustBoot(const char *ipsw, string bootargs){ for (int i=0;getDeviceMode(true) != MODE_RECOVERY && i<40; i++) putchar('.'),usleep(USEC_PER_SEC*0.5); putchar('\n'); - if (!check_mode(client)) reterror(-15, "failed to reconnect to device in recovery (iBEC) mode\n"); get_ecid(client, &client->ecid); - client->flags |= FLAG_BOOT; - if (client->mode->index == MODE_RECOVERY) { if (client->srnm == NULL) { - reterror(-9,"ERROR: could not retrieve device serial number. Can't continue.\n"); + reterror(-9,"ERROR: couldn't retrieve device serial number. Can't continue.\n"); } if (irecv_send_command(client->recovery->client, "bgcolor 0 255 0") != IRECV_E_SUCCESS) { error("ERROR: Unable to set bgcolor\n"); return -1; } info("[WARNING] Setting bgcolor to green! If you don't see a green screen, then your device didn't boot iBEC correctly\n"); - sleep(2); //show the user a green screen! - client->image4supported = true; //dirty hack to not require apticket + sleep(2); + client->image4supported = true; // dirty hack to not require ApTicket if (recovery_enter_restore(client, build_identity) < 0) { reterror(-10,"ERROR: Unable to place device into restore mode\n"); } @@ -1080,7 +1038,7 @@ futurerestore::~futurerestore(){ void futurerestore::loadFirmwareTokens(){ if (!_firmwareTokens){ if (!_firmwareJson) _firmwareJson = getFirmwareJson(); - if (!_firmwareJson) reterror(-6,"[TSSC] could not get firmware.json\n"); + if (!_firmwareJson) reterror(-6,"[TSSC] couldn't get firmware.json\n"); int cnt = parseTokens(_firmwareJson, &_firmwareTokens); if (cnt < 1) reterror(-2,"[TSSC] parsing %s.json failed\n",(0) ? "ota" : "firmware"); } @@ -1088,7 +1046,6 @@ void futurerestore::loadFirmwareTokens(){ irecv_device_t futurerestore::loadDeviceInfo(){ if (!_client->device || !_client->device->product_type){ - int mode = getDeviceMode(true); if (mode != MODE_NORMAL && mode != MODE_RECOVERY && mode != MODE_DFU) reterror(-20, "unexpected device mode=%d\n",mode); @@ -1129,10 +1086,10 @@ char *futurerestore::getLatestManifest(){ ptr_smartautofree(versVals.version); __latestFirmwareUrl = getFirmwareUrl(device, &versVals, _firmwareTokens); - if (!__latestFirmwareUrl) reterror(-21, "could not find URL of latest firmware\n"); + if (!__latestFirmwareUrl) reterror(-21, "couldn't find URL of latest firmware\n"); __latestManifest = getBuildManifest(__latestFirmwareUrl, device, versVals.version, versVals.buildID, 0); - if (!__latestManifest) reterror(-22, "could not get buildmanifest of latest firmware\n"); + if (!__latestManifest) reterror(-22, "couldn't get buildmanifest of latest firmware\n"); } return __latestManifest; @@ -1147,7 +1104,7 @@ void futurerestore::loadLatestBaseband(){ char *pathStr = getPathOfElementInManifest("BasebandFirmware", manifeststr, _client, 0); info("downloading baseband\n\n"); if (downloadPartialzip(getLatestFirmwareUrl(), pathStr, _basebandPath = BASEBAND_TMP_PATH)) - reterror(-32, "could not download baseband\n"); + reterror(-32, "couldn't download baseband\n"); saveStringToFile(manifeststr, BASEBAND_MANIFEST_TMP_PATH); setBasebandPath(BASEBAND_TMP_PATH); setBasebandManifestPath(BASEBAND_MANIFEST_TMP_PATH); @@ -1158,7 +1115,7 @@ void futurerestore::loadLatestSep(){ char *pathStr = getPathOfElementInManifest("SEP", manifeststr, _client, 0); info("downloading SEP\n\n"); if (downloadPartialzip(getLatestFirmwareUrl(), pathStr, SEP_TMP_PATH)) - reterror(-33, "could not download SEP\n"); + reterror(-33, "couldn't download SEP\n"); loadSep(SEP_TMP_PATH); saveStringToFile(manifeststr, SEP_MANIFEST_TMP_PATH); setSepManifestPath(SEP_MANIFEST_TMP_PATH); @@ -1220,17 +1177,14 @@ char *futurerestore::getNonceFromSCAB(const char* scab, size_t *nonceSize){ char *nonceOctet = NULL; if (!scab) reterror(-15, "Got empty SCAB\n"); - if (asn1ElementsInObject(scab)< 4){ - error("unexpected number of Elements in SCAB sequence\n"); + error("unexpected number of elements in SCAB sequence\n"); goto error; } if (nonceSize) *nonceSize = 0; mainSet = asn1ElementAtIndex(scab, 1); - elems = asn1ElementsInObject(mainSet); - for (int i=0; i #include #include - #include + #include +#include "config.h" #include "idevicerestore.h" #if defined _WIN32 || defined __CYGWIN__ -#ifndef WIN32 -//make sure WIN32 is defined if compiling for windows +#ifndef WIN32 //make sure WIN32 is defined if compiling for windows #define WIN32 #endif #endif diff --git a/futurerestore/main.cpp b/futurerestore/main.cpp index 0247aa31a..967f9c84f 100644 --- a/futurerestore/main.cpp +++ b/futurerestore/main.cpp @@ -75,14 +75,14 @@ void cmd_help(){ printf(" --exit-recovery\t\tExit recovery mode and quit\n"); printf("\nOptions for SEP:\n"); - printf(" --latest-sep\t\tUse latest signed sep instead of manually specifying one (may cause bad restore)\n"); + printf(" --latest-sep\t\tUse latest signed SEP instead of manually specifying one (may cause bad restore)\n"); printf(" -s, --sep PATH\t\tSEP to be flashed\n"); printf(" -m, --sep-manifest PATH\tBuildManifest for requesting SEP ticket\n"); #ifdef HAVE_LIBIPATCHER - printf("\nOptions for Odysseus method:\n"); - printf(" --use-pwndfu\t\tuse this for restoring devices with Odysseus method. Device needs to be in kDFU mode already\n"); - printf(" --just-boot=\"-v\"\t\tuse this to tethered boot the device from kDFU mode. You can optionally set boot-args\n"); + printf("\nOptions for 32-bit downgrading:\n"); + printf(" --use-pwndfu\t\tuse this for restoring devices with Odysseus method. Device needs to be in pwned DFU mode already\n"); + printf(" --just-boot=\"-v\"\t\tuse this to tethered boot the device from pwned DFU mode. You can optionally set boot-args\n"); #endif printf("\nOptions for baseband:\n"); From 536fee9e67dbc2842b2e461bb0d23cfd0f6cf903 Mon Sep 17 00:00:00 2001 From: s0uthwest <42713499+s0uthwest@users.noreply.github.com> Date: Tue, 2 Jul 2019 17:32:11 +0300 Subject: [PATCH 67/69] Update ReadMe --- ReadMe.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/ReadMe.md b/ReadMe.md index 8a68c0e15..f5d914afe 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -3,9 +3,7 @@ _futurerestore is a hacked up idevicerestore wrapper, which allows manually spec __Only use if you are sure what you're doing.__ --- -Latest release available [here](https://github.com/s0uthwest/futurerestore/releases) for macOS & Windows. - -I'll compile only macOS version, Windows & Linux version won't be compiled by me. +Latest release available [here](https://github.com/s0uthwest/futurerestore/releases) for macOS & Windows. I'll compile only macOS/Windows versions, Linux version won't be compiled by me. ## Features * Supports the following downgrade methods: @@ -100,10 +98,11 @@ Use utilities for setting boot-nonce generator: #### Method 3: Using jailbreak tools Use jailbreak tools for setting boot-nonce generator: -1. [backr00m](https://nito.tv) or greeng0blin for tvOS 10.2-11.1; -2. [Electra and ElectraTV](https://coolstar.org/electra) for iOS and tvOS 11.x; -3. [unc0ver](https://github.com/pwn20wndstuff/Undecimus/releases) for iOS 11.0-12.1.2; -4. [Chimera and ChimeraTV](https://chimera.sh) for iOS 12.0-12.1.2 and tvOS 12.0-12.1.1. +1. [Meridian](https://meridian.sparkes.zone) for iOS 10.x; +2. [backr00m](https://nito.tv) or greeng0blin for tvOS 10.2-11.1; +3. [Electra and ElectraTV](https://coolstar.org/electra) for iOS and tvOS 11.x; +4. [unc0ver](https://github.com/pwn20wndstuff/Undecimus/releases) for iOS 11.0-12.1.2; +5. [Chimera and ChimeraTV](https://chimera.sh) for iOS 12.0-12.1.2 and tvOS 12.0-12.1.1. ### Activate tfp0 if jailbreak doesn't allow it #### Method 1 (if jailbroken on 9.2-9.3.x) @@ -213,4 +212,5 @@ Creator of [original project](https://github.com/tihmstar/futurerestore) - [tihm ReadMe updated on: - 2019-06-20 + + 2019-07-02 From 8def7202fe46ffa6b346182c4d44738f21445bcd Mon Sep 17 00:00:00 2001 From: s0uthwest Date: Wed, 25 Dec 2019 06:41:59 -0800 Subject: [PATCH 68/69] TSSChecker: change to original's @tihmstar's version --- external/tsschecker | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external/tsschecker b/external/tsschecker index c0b554e83..78c1203bc 160000 --- a/external/tsschecker +++ b/external/tsschecker @@ -1 +1 @@ -Subproject commit c0b554e83f54d39d90cac9791160bf2ccb062aed +Subproject commit 78c1203bcb326dcc813cc24cce2df6b88c01eef4 From 08d0e0006c7307397ad26273458d31b025eb2549 Mon Sep 17 00:00:00 2001 From: s0uthwest Date: Wed, 25 Dec 2019 06:42:11 -0800 Subject: [PATCH 69/69] img4tool: fixes name of submodule --- external/img4tool | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external/img4tool b/external/img4tool index dd9b385e6..8780189f2 160000 --- a/external/img4tool +++ b/external/img4tool @@ -1 +1 @@ -Subproject commit dd9b385e6954b8d12021fd0c56e53d5ba760b80a +Subproject commit 8780189f2dd064395d15d996f490d5f4435e8aa0