Compare commits

...

97 commits
v90 ... master

Author SHA1 Message Date
tihmstar 76ae6df6f9
Create FUNDING.yml 2023-08-15 19:52:20 +02:00
tihmstar 2f0686d355
Merge pull request #321 from 0x9fff00/patch-1
Update libplist and libirecovery names for 2.2.0/1.0.0
2020-11-19 09:54:15 +01:00
tihmstar a2f7d7218d
Merge pull request #338 from Diatrus/patch-1
Fix compiling with latest libipatcher
2020-11-19 09:53:25 +01:00
Hayden f47d5e48c0
Fix compiling with latest libipatcher 2020-10-28 21:44:19 -04:00
0x9fff00 63c170b9bc
Update libplist and libirecovery names for 2.2.0/1.0.0 2020-06-20 20:35:10 +02:00
0x9fff00 88861b6128
Exclude subdirs from install
Co-authored-by: Luke S. <luke@street.dev>
2020-02-08 23:41:58 +03:00
0x9fff00 4dd98dc56f
Don't overwrite CFLAGS 2020-02-08 23:40:35 +03:00
s0uthwest 38b168002b Probably fix issue with baseband restore (#295) & (#296) 2020-01-03 06:56:50 -08:00
s0uthwest f8f2e79e09 idevicerestore: update socket library 2019-12-25 23:45:45 -08:00
s0uthwest e5792d8123 Changing locale and ReadMe for latest Apple names 2019-12-25 13:20:34 -08:00
s0uthwest 29680274ae 10 second timer for non-bb restoring 2019-12-25 11:10:16 -08:00
s0uthwest a23c6e00a8 SEP alert as a baseband 2019-12-25 11:09:55 -08:00
s0uthwest 3e5916c78c Actualizing submodules 2019-12-25 11:07:58 -08:00
s0uthwest 7720c6ef52 Windows 10: enable virtual terminal processing
Co-Authored-By: Luke S. <luke@street.dev>
2019-12-25 11:06:44 -08:00
s0uthwest c02e9d5876 Add option "--exit-recovery"
Co-Authored-By: Luke S. <luke@street.dev>
2019-12-25 11:01:47 -08:00
s0uthwest 13a14f7e96 Xcode: compiling with latest libraries; removed unused tsschecker header at all 2019-12-25 09:55:59 -08:00
tihmstar 265c1bbca0 removed unused tsschecker header 2019-11-05 23:57:13 +01:00
tihmstar 18839f36db Merge branch 'master' of github.com:tihmstar/futurerestore 2019-11-05 23:35:29 +01:00
tihmstar d5b65775be odysseus64bit 2019-11-05 23:35:01 +01:00
s0uthwest 3edd562a62 TSSChecker: update submodule with latest changes 2019-11-04 13:15:41 -08:00
tihmstar 6a3c8c2c9d updated idevicerestore 2019-11-03 15:37:34 +01:00
tihmstar 792d9498ef fixed compile error 2019-11-03 15:35:55 +01:00
tihmstar c71a4e73dc fixed done message 2019-11-03 15:32:58 +01:00
tihmstar e4332ed20a fixed version display 2019-11-03 15:29:10 +01:00
tihmstar 923d8168e5 added option to ignore bad ramdisk hashes 2019-11-03 15:15:05 +01:00
tihmstar 7298131780 using libgeneral as library instad of submodule 2019-11-03 14:41:22 +01:00
tihmstar 2988d63b97 update idevicerestore 2019-11-03 13:45:07 +01:00
tihmstar def6e7ba8f WIP updating idevicerestore 2019-11-03 13:36:05 +01:00
tihmstar 292fca0e02 added support for odysseus 64bit (warning untested!) 2019-11-02 23:25:47 +01:00
tihmstar c0fd39374b removed img4tool submodule 2019-11-02 16:15:16 +01:00
s0uthwest ae3164f767
Enable ignoring some files for pushing into github 2019-10-13 22:12:09 +03:00
tihmstar 4a8cabbe55 updated libipatcher dependency 2018-01-01 18:01:48 +01:00
tihmstar e740b28b1d fixed bug when futurerestore would send another stock iBEC when restoring to iOS 10 in pwndfu 2017-12-31 17:41:54 +01:00
tihmstar 17839c1019 don't use custom send function when dealing with iOS 10 32bit on pwndfu 2017-12-30 11:10:09 +01:00
tihmstar 451804fd96 blocking update install in pwndfu mode 2017-10-09 00:36:57 +02:00
tihmstar b99eb8140d added just-boot to helpscreen 2017-07-27 14:55:08 +02:00
tihmstar c90da707b1 added support, for booting with custom bootargs from pwndfu 2017-07-27 14:47:23 +02:00
tihmstar f068ddb057 updated dependencies 2017-07-01 13:32:14 +02:00
tihmstar f34ed2c051 Update README.md 2017-06-28 10:53:59 +02:00
tihmstar 0abdf46226 Merge pull request #140 from RoyalGraphX/patch-2
Fix typo and add debug flag
2017-06-27 08:15:14 +02:00
tihmstar 373ddcdffe added support for re-restoring to iOS 9 with noNonce bug from DFU mode 2017-06-26 21:19:48 +02:00
tihmstar 32932a396c updated min libipatcher lib 2017-06-26 13:14:43 +02:00
tihmstar 1ea6a66658 replaced pkg-config -> $PKG_CONFIG 2017-06-25 20:25:59 +02:00
Alan Moreno a177561c31 Fix typo and add debug flag 2017-06-22 21:09:05 -05:00
tihmstar 6a606d478f updated min libipatcher version 2017-06-19 16:38:47 +02:00
tihmstar 231bdc251c fixed normalmode discovery bug 2017-06-18 14:38:00 +02:00
tihmstar d1e5c41aff added a little more error logging 2017-06-18 11:55:13 +02:00
tihmstar b3f684d61b fixed missing symbol when compiling without libipatcher 2017-06-07 22:41:45 +02:00
tihmstar 58ddfb4030 updaed makefile to search for jssy header 2017-06-07 17:44:03 +02:00
tihmstar e3d8b85370 updated dependencies 2017-06-07 17:39:58 +02:00
tihmstar b215ccdc07 set minimum libipatcher version 2017-06-07 16:32:55 +02:00
tihmstar 1a1779da46 changed the way printing version looks 2017-06-07 16:19:45 +02:00
tihmstar 1a87c28c38 added libipatcher version info 2017-06-07 16:18:00 +02:00
tihmstar 5879ea8132 dependency update 2017-06-04 18:45:20 +02:00
tihmstar d54ec2fb8a updated dependencies 2017-06-04 18:41:25 +02:00
tihmstar 0fb9cdf851 added error handling code 2017-06-04 09:06:12 +02:00
tihmstar 644abb1832 update on optional feature 2017-06-02 20:27:08 +02:00
tihmstar b895ddf146 actually fixed helpscreen 2017-06-02 20:23:32 +02:00
tihmstar fb006b9fdc fixed helpscreen 2017-06-02 20:22:09 +02:00
tihmstar f286d3d27d updated dependencies 2017-06-02 20:20:58 +02:00
tihmstar d1c90d1185 added optional libipatcher support 2017-06-02 20:07:10 +02:00
tihmstar de907d3fa8 Merge pull request #123 from RoyalGraphX/patch-1
Updated Options chart
2017-05-24 13:54:52 +02:00
Alan Moreno bac8b373ff Updated Options chart 2017-05-20 15:57:39 -05:00
tihmstar 80c0eee322 actually fixed the type issue 2017-04-27 15:42:07 +02:00
tihmstar 920941159a fixed type error when compiling with openssl (hopefully) 2017-04-27 15:37:12 +02:00
tihmstar a3b088fd50 Update README.md 2017-04-25 17:46:51 +02:00
tihmstar dd27b0cd99 Update README.md 2017-04-25 17:46:27 +02:00
tihmstar 3f176cf799 added README 2017-04-25 17:45:07 +02:00
tihmstar 7496ed3607 checking SEP to match sepmanifest 2017-04-25 17:19:27 +02:00
tihmstar 42b37c5c71 updated dependencies 2017-04-25 16:05:28 +02:00
tihmstar e2d0d263e5 only using shsh file with no nonce, when current and dst iBoot is iOS 9 2017-04-07 17:04:30 +02:00
tihmstar 99da4c3352 printing apnonce 2017-04-04 11:06:35 +02:00
tihmstar 58baea2135 fixed 64bit device detection 2017-04-04 11:00:17 +02:00
tihmstar 7152d931c9 reverting commenting out code by accident 2017-04-03 13:02:45 +02:00
tihmstar 8d32355d6f removed buggy feature 2017-04-03 12:57:57 +02:00
tihmstar ace8ae144f adding support for gzip compressed shsh files 2017-04-03 12:45:47 +02:00
tihmstar eeefc9ef41 changed the way of detecting 32bit/64bit devices on init 2017-04-03 08:28:19 +02:00
tihmstar 364a4704d4 Merge branch 'master' of github.com:tihmstar/futurerestore 2017-04-03 08:25:21 +02:00
tihmstar a04884ce07 added ramdisk hash check 2017-04-03 08:25:12 +02:00
tihmstar 1f0cda0d06 Merge pull request #98 from matteyeux/master
removed "--is-32bit line"
2017-04-02 18:00:28 +02:00
mathieu dca7f24b81 removed --is-32bit 2017-04-02 16:12:59 +02:00
tihmstar d8b69365ec fully supporting 32bit devices now
-autodetecting 32bit devices (removing --is-32bit parameter)
2017-04-02 13:42:27 +02:00
tihmstar 12066c924e fixed -w for 32bit 2017-03-30 15:02:47 +02:00
tihmstar 45058a2e2c added error handling when loading shsh files fails 2017-03-30 14:38:52 +02:00
tihmstar c119b17543 removing option to skip checks on 32bit devices 2017-03-30 14:25:35 +02:00
tihmstar 2180c5602e updated dependencies 2017-03-30 14:20:21 +02:00
tihmstar 53853c6d58 added parsing for 32bit ecid and nonce 2017-03-30 14:18:29 +02:00
tihmstar c271a71524 printing ecid in decimal afterall 2017-03-29 11:52:05 +02:00
tihmstar f218dc32d3 clearing some confusion about ecid encoding (hex) 2017-03-29 11:49:15 +02:00
tihmstar ef617cf2e6 using alternative restoremode for baseband as fallback 2017-03-29 11:45:16 +02:00
tihmstar d7389b76a3 updated required dependencies 2017-03-29 11:33:01 +02:00
tihmstar 422c69cbd9 adding beta support for 32bit devices 2017-03-29 11:32:13 +02:00
tihmstar 9fcf613f8f added ECID check 2017-03-26 21:17:20 +02:00
tihmstar 481d959a5e updated dependencies (restoring to 10.3 should work now) 2017-03-26 10:53:26 +02:00
tihmstar 0b14382adf trying to fix segfault 11, updated img4tool dependency 2017-03-25 12:08:32 +01:00
tihmstar 36be0769f2 now verifying APTicket signature prior to attempting to restore 2017-03-23 12:25:53 +01:00
tihmstar 5d2f24dd19 updated dependencies 2017-03-20 15:13:55 +01:00
18 changed files with 1705 additions and 623 deletions

13
.github/FUNDING.yml vendored Normal file
View file

@ -0,0 +1,13 @@
# These are supported funding model platforms
github: [tihmstar]
patreon: tihmstar
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']

24
.gitignore vendored Normal file
View file

@ -0,0 +1,24 @@
*.DS_Store
*.a
*.o
*.la
*.lo
*.so
*/.libs
*/.deps
*Makefile
*Makefile.in
aclocal.m4
autom4te.cache
compile
config.*
configure
depcomp
install-sh
libtool
ltmain.sh
m4
missing
*/futurerestore*
stamp-h1
xcuserdata

3
.gitmodules vendored
View file

@ -1,6 +1,3 @@
[submodule "external/img4tool"]
path = external/img4tool
url = https://github.com/tihmstar/img4tool.git
[submodule "external/tsschecker"]
path = external/tsschecker
url = https://github.com/tihmstar/tsschecker.git

View file

@ -1,3 +1,4 @@
AUTOMAKE_OPTIONS = foreign
ACLOCAL_AMFLAGS = -I m4
SUBDIRS = external/idevicerestore external/img4tool external/tsschecker futurerestore
SUBDIRS = external/idevicerestore external/tsschecker futurerestore
install installdirs: SUBDIRS = futurerestore

249
README.md Normal file
View file

@ -0,0 +1,249 @@
# futurerestore
_It is a hacked up idevicerestore wrapper, which allows manually specifying SEP and Baseband for restoring._
Latest compiled version can be found [here](https://github.com/tihmstar/futurerestore/releases).
__Only use if you are sure what you're doing.__
---
# Features
* Supports the following downgrade methods:
* Prometheus 64-bit devices (generator and ApNonce collision mode)
* Odysseus for 32-bit & 64-bit (A7-A11) devices
* Re-restoring 32-bit devices to iOS 9.x with [alitek123](https://github.com/alitek12)'s no-ApNonce method (alternative — [idevicererestore](https://downgrade.party)).
* Allows restoring to non-matching firmware with custom SEP+baseband
# Dependencies
* ## 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);
* [libplist](https://github.com/libimobiledevice/libplist);
* [libusbmuxd](https://github.com/libimobiledevice/libusbmuxd);
* [libirecovery](https://github.com/libimobiledevice/libirecovery);
* [libimobiledevice](https://github.com/libimobiledevice/libimobiledevice);
* [img4tool](https://github.com/tihmstar/img4tool);
* [liboffsetfinder64](https://github.com/tihmstar/liboffsetfinder64);
* [libipatcher](https://github.com/tihmstar/libipatcher)
* ## Submodules
Make sure these projects compile on your system (install it's dependencies):
* [jssy](https://github.com/tihmstar/jssy);
* [tsschecker](https://github.com/tihmstar/tsschecker);
* [idevicerestore](https://github.com/tihmstar/idevicerestore)
## Report an issue
You can do it [here](https://github.com/tihmstar/futurerestore/issues).
### Restoring on Windows 10
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 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);
9. Go back to futurerestore once again and repeat the restore process;
10. The device will reboot and error `-10` will also be solved;
11. The restore will now proceed and succeed.
### 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.
# Help
_(might become outdated):_
Usage: `futurerestore [OPTIONS] iPSW`
| option (short) | option (long) | description |
|----------------|------------------------------------------|-----------------------------------------------------------------------------------|
| ` -t ` | ` --apticket PATH ` | Signing tickets used for restoring |
| ` -u ` | ` --update ` | Update instead of erase install (requires appropriate APTicket) |
| | | DO NOT use this parameter, if you update from jailbroken firmware! |
| ` -w ` | ` --wait ` | Keep rebooting until ApNonce matches APTicket (ApNonce collision, unreliable) |
| ` -d ` | ` --debug ` | Show all code, use to save a log for debug testing |
| ` -e ` | ` --exit-recovery ` | Exit recovery mode and quit |
| | ` --use-pwndfu ` | Restoring devices with Odysseus method. Device needs to be in pwned DFU mode already |
| | ` --just-boot "-v" ` | Tethered booting the device from pwned DFU mode. You can optionally set ` boot-args ` |
| | ` --latest-sep ` | Use latest signed SEP instead of manually specifying one (may cause bad restore) |
| ` -s ` | ` --sep PATH ` | SEP to be flashed |
| ` -m ` | ` --sep-manifest PATH ` | BuildManifest for requesting SEP ticket |
| | ` --latest-baseband ` | Use latest signed baseband instead of manually specifying one (may cause bad restore) |
| ` -b ` | ` --baseband PATH ` | Baseband to be flashed |
| ` -p ` | ` --baseband-manifest PATH ` | BuildManifest for requesting baseband ticket |
| | ` --no-baseband ` | Skip checks and don't flash baseband |
| | | Only use this for device without a baseband (eg. iPod touch or some Wi-Fi only iPads) |
---
## 0) What futurerestore can do
**Downgrade/Upgrade/Re-restore same mobile firmware version.**
Whenever you read "downgrade" nowadays it means you can also upgrade and re-restore if you're on the same firmware version. Basically this allows restoring an firmware version and the installed firmware version doesn't matter.
---
## 1) Prometheus (64-bit device) - generator method
### Requirements
- Jailbreak
- signing ticket files (`.shsh`, `.shsh2`, `.plist`) with a generator
- nonceEnabler patch enabled
### Info
You can downgrade, if the destination firmware version is compatible with the **latest signed SEP and baseband** and if you **have a signing tickets files with a generator for that firmware version**.
### How to use
1. Device must be jailbroken and nonceEnabler patch must be active
2. Open signing ticket file and look up the generator
* Looks like this: `<key>generator</key><string>0xde3318d224cf14a1</string>`
3. Write the generator to device's NVRAM
* Connect with SSH into the device and run `nvram com.apple.System.boot-nonce=0xde3318d224cf14a1` to set the generator *0xde3318d224cf14a1*
* verify it 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
<a href="http://www.youtube.com/watch?feature=player_embedded&v=BIMx2Y13Ukc" target="_blank"><img src="http://img.youtube.com/vi/BIMx2Y13Ukc/0.jpg" alt="Prometheus" width="240" height="180"/></a>
*Prometheus*
<a href="http://www.youtube.com/watch?feature=player_embedded&v=UXxpUH71-s4" target="_blank"><img src="http://img.youtube.com/vi/UXxpUH71-s4/0.jpg" alt="Prometheus" width="240" height="180"/></a>
*nonceEnabler*
### 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`.
#### Method 2: Using special applications
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;
6. [GeneratorAutoSetter](https://github.com/Halo-Michael/GeneratorAutoSetter) for checkra1n jailbreak on iOS / iPadOS 13.x. Install it from Cydia's developer repo (https://halo-michael.github.io/repo/) on device.
#### Method 3: Using jailbreak tools
Use jailbreak tools for setting boot-nonce generator:
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://unc0ver.dev) for iOS 11.0-12.2, 12.4.x;
5. [Chimera and ChimeraTV](https://chimera.sh) for iOS 12.0-12.2, 12.4 and tvOS 12.0-12.2, 12.4.
### Activate tfp0, if jailbreak doesn't allow it
#### Method 1 (if jailbroken on iOS 9.2-9.3.x)
* 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
#### 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
* Use [cl0ver](https://github.com/Siguza/cl0ver) for iOS 9.x.
---
## 2) Prometheus (64-bit device) - ApNonce collision method (Recovery mode)
### Requirements
- **Device with A7 chip on iOS 9.1 - 10.2 or iOS 10.3 beta 1**;
- Jailbreak doesn't required;
- Signing ticket files (`.shsh`, `.shsh2`, `.plist`) with a customly chosen ApNonce;
- Signing ticket files needs to have one of the ApNonces, which the device generates a lot;
### Info
You can downgrade if the destination firmware version, if it is compatible with the **latest signed SEP and baseband**. You also need to have **special signing ticket 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 or recovery mode;
2. On the computer run `futurerestore -w -t ticket.shsh --latest-baseband --latest-sep firmware.ipsw`
* If you have saved multiple signing 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 firmware.ipsw`
---
## 3) Prometheus (64-bit device) - ApNonce collision method (DFU mode)
### Requirements
- __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 firmwares;__
- __Devices have been released after ~September, 2015 {PROBABLY};__
- Jailbreak doesn't required;
- Signing ticket files (`.shsh`, `.shsh2`, `.plist`) with a customly chosen APNonce;
- Signing ticket files needs to have one of the ApNonces, which the device generates a lot;
- __[img4tool](https://github.com/tihmstar/img4tool) can't be used for Windows [problem with signing iBSS/iBEC], now it's TO-DO;__
### Info
You can downgrade if the destination firmware version, if it is compatible with the **latest signed SEP and baseband**. You also need to have **special signing ticket 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 checking ApNonce, which booted in DFU;
3. Extract iBSS/iBEC from target firmware for downgrade (unsigned);
4. Check DFU-collisioned ApNonces with [irecovery](https://github.com/libimobiledevice/libirecovery), which booted in DFU.
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 for sign iBSS:
`img4tool -s ticket.shsh -c iBSS.signed -p <original_iBSS>`;
6. Use img4tool for sign iBEC:
`img4tool -s ticket.shsh -c iBEC.signed -p <original_iBEC>`;
7. So, after signing we can boot into Recovery with irecovery.
`irecovery -f iBSS.signed` - loading iBSS;
`irecovery -f iBEC.signed` - loading iBEC;
8. So good! On the computer run `futurerestore -t ticket.shsh --latest-baseband --latest-sep -w firmware.ipsw`.
---
## 4) Odysseus (32-bit / 64-bit devices)
### Requirements
- futurerestore compiled with libipatcher;
- Jailbreak or bootrom exploit (limera1n, checkm8);
- **32-bit**: firmware keys for the device/destination firmware version must be public (check ipsw.me);
- **64-bit**: devices with **A12** and **A13** chips is **NOT** compatible with this method;
- Signing ticket files (`.shsh`, `.shsh2`, `.plist`) from by destination firmware (OTA blobs work too!).
### Info
If you have a jailbroken device, you can downgrade to **any** firmware version you have blobs for. You can still get OTA blobs for iOS 6.1.3, 8.4.1 or 10.3.3 for some devices and use those.
### How to use
1. Get device into kDFU/pwnDFU
* Pre-iPhone4s (limera1n devices):
* Enter to pwnDFU mode with redsn0w or any other tool
* iPhone 4s and later 32-bit devices:
* Enter to kDFU mode with kDFU app (cydia: repo.tihmstar.net) or by loading a pwnediBSS from any existing odysseus bundle
* Any 64-bit device:
* Enter to pwnDFU mode and patch signature check with special fork of [ipwndfu](https://github.com/LinusHenze/ipwndfu_public)
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 firmware.ipsw`
### Youtube
<a href="http://www.youtube.com/watch?feature=player_embedded&v=FQfcybsEWmM" target="_blank"><img src="http://img.youtube.com/vi/FQfcybsEWmM/0.jpg" alt="Odysseus" width="240" height="180"/></a> *futurerestore + libipatcher*
<a href="http://www.youtube.com/watch?feature=player_embedded&v=8Ro4g6StPeI" target="_blank"><img src="http://img.youtube.com/vi/8Ro4g6StPeI/0.jpg" alt="Odysseus" width="240" height="180"/></a> *kDFU app*
<a href="http://www.youtube.com/watch?feature=player_embedded&v=Wo7mGdMcjxw" target="_blank"><img src="http://img.youtube.com/vi/Wo7mGdMcjxw/0.jpg" alt="Odysseus" width="240" height="180"/></a> *Enter kDFU mode (watch up to the point where the screen goes black)*
You can use **any** odysseus bundle for this.
## 5) iOS 9.x re-restore bug by @alitek123 (only for 32-bit devices)
### Requirements
- Jailbreak doesn't required;
- Signing ticket files (`.shsh`, `.shsh2`, `.plist`) from by iOS 9.x without ApNonce (noNonce APTickets)
### Info
If you have **signing tickets files for iOS 9.x**, which **do not contain a ApNonce**, you can restore to that firmware.
### How to use
1. Connect your device in DFU mode
2. On the computer run `futurerestore -t ticket.shsh --latest-baseband ios9.ipsw`

View file

@ -1,18 +1,19 @@
#!/bin/bash
gprefix=`which glibtoolize 2>&1 >/dev/null`
if [ $? -eq 0 ]; then
if [ $? -eq 0 ]; then
glibtoolize --force
else
libtoolize --force
fi
aclocal -I m4
autoconf
autoheader
automake --add-missing
autoconf
autoreconf -i
export NOCONFIGURE=1
SUBDIRS="external/idevicerestore external/img4tool external/tsschecker"
SUBDIRS="external/idevicerestore external/tsschecker"
for SUB in $SUBDIRS; do
pushd $SUB
./autogen.sh
@ -24,5 +25,3 @@ unset NOCONFIGURE
if [ -z "$NOCONFIGURE" ]; then
./configure "$@"
fi
./setBuildVersion.sh

View file

@ -1,10 +1,24 @@
AC_PREREQ(2.64)
AC_INIT([futurerestore], [1.0], [http://url.me/issues],, [http://url.me])
AC_PREREQ([2.69])
AC_INIT([futurerestore], m4_esyscmd([git rev-list --count HEAD | tr -d '\n']), [tihmstar@gmail.com])
AC_CANONICAL_SYSTEM
AC_CANONICAL_HOST
# Check for operating system
AM_INIT_AUTOMAKE([subdir-objects])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIRS([m4])
# Versioning.
AC_DEFINE([VERSION_COMMIT_COUNT], "m4_esyscmd([git rev-list --count HEAD | tr -d '\n'])", [Git commit count])
AC_DEFINE([VERSION_COMMIT_SHA], "m4_esyscmd([git rev-parse HEAD | tr -d '\n'])", [Git commit sha])
AC_SUBST([VERSION_COMMIT_COUNT], ["m4_esyscmd([git rev-list --count HEAD | tr -d '\n'])"])
AC_SUBST([VERSION_COMMIT_SHA], ["m4_esyscmd([git rev-parse HEAD | tr -d '\n'])"])
# Checks for programs.
AC_PROG_CXX
AC_PROG_CC
# Check for operating system.
AC_MSG_CHECKING([whether we need platform-specific build settings])
case $host_os in
darwin* )
@ -12,30 +26,62 @@ case $host_os in
;;
esac
AM_INIT_AUTOMAKE
CFLAGS="-DIDEVICERESTORE_NOMAIN=1 -DIMG4TOOL_NOMAIN=1 -DTSSCHECKER_NOMAIN=1"
# Checks the flags.
CFLAGS+=" -DIDEVICERESTORE_NOMAIN=1 -DTSSCHECKER_NOMAIN=1"
CXXFLAGS+=" -std=c++11"
CFLAGS+=" -std=c11"
AC_DEFUN([AX_UNPRECIOUS], [
m4_define([_AC_PRECIOUS_VARS], m4_bpatsubst(_AC_PRECIOUS_VARS, [$1
], []))
m4_define([_AC_PRECIOUS_VARS], m4_bpatsubst(_AC_PRECIOUS_VARS, [$1], []))
])
AX_UNPRECIOUS([CFLAGS])
export CFLAGS
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIRS([m4])
AC_CONFIG_SUBDIRS(external/idevicerestore external/img4tool external/tsschecker)
AC_CONFIG_SUBDIRS(external/idevicerestore external/tsschecker)
AC_CONFIG_SRCDIR([futurerestore])
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)
# Checks the libraries.
LIBIPATCHER_REQUIRES_STR="libipatcher >= 61"
LIBPLIST_REQUIRES_STR="libplist-2.0 >= 2.2.0"
LIBZIP_REQUIRES_STR="libzip >= 0.10"
LIBIMOBILEDEVICE_REQUIRES_STR="libimobiledevice-1.0 >= 1.2.1"
LIBFRAGMENTZIP_REQUIRES_STR="libfragmentzip >= 47"
LIBIRECOVERY_REQUIRES_STR="libirecovery-1.0 >= 1.0.0"
IMG4TOOL_REQUIRES_STR="libimg4tool >= 162"
LIBGENERAL_REQUIRES_STR="libgeneral >= 26"
AC_PROG_CC
AC_PROG_CXX
PKG_CHECK_MODULES(libplist, $LIBPLIST_REQUIRES_STR)
PKG_CHECK_MODULES(libzip, $LIBZIP_REQUIRES_STR)
PKG_CHECK_MODULES(libimobiledevice, $LIBIMOBILEDEVICE_REQUIRES_STR)
PKG_CHECK_MODULES(libfragmentzip, $LIBFRAGMENTZIP_REQUIRES_STR)
PKG_CHECK_MODULES(libirecovery, $LIBIRECOVERY_REQUIRES_STR)
PKG_CHECK_MODULES(libimg4tool, $IMG4TOOL_REQUIRES_STR)
PKG_CHECK_MODULES(libgeneral, $LIBGENERAL_REQUIRES_STR)
# Optional module libipatcher
AC_ARG_WITH([libipatcher],
[AS_HELP_STRING([--without-libipatcher],
[build with bundle-less odysseus support (default is yes)])],
[build_libipatcher=false],
[build_libipatcher=true])
PKG_PROG_PKG_CONFIG
LIBIPATCHER_FLAGS=$($PKG_CONFIG --cflags libipatcher)
if [test -z "$LIBIPATCHER_FLAGS"]; then
do_libipatcher=no
else
AC_MSG_CHECKING([for futurerestore libipatcher])
if test "$build_libipatcher" = "true"; then
PKG_CHECK_MODULES(libipatcher, $LIBIPATCHER_REQUIRES_STR)
AC_DEFINE(HAVE_LIBIPATCHER, 1, [Define if you have libipatcher])
do_libipatcher=yes
else
do_libipatcher=no
fi
fi
AM_CONDITIONAL([HAVE_LIBIPATCHER],[test "x$do_libipatcher" = "xyes"])
AC_DEFINE(CUSTOM_LOGGING, 1, [required for futurerestore])
LT_INIT
@ -43,3 +89,13 @@ AC_OUTPUT([
Makefile
futurerestore/Makefile
])
echo "
Configuration for $PACKAGE $VERSION:
-------------------------------------------
Install prefix ..........: $prefix
With libipatcher ........: $do_libipatcher
Now type 'make' to build $PACKAGE $VERSION,
and then 'make install' for installation.
"

@ -1 +1 @@
Subproject commit cf48be0b3da7ba3e4b21e513c9746e299c400771
Subproject commit c97e02e22b9971471db5dcb3b9e02eb30222d6c0

1
external/img4tool vendored

@ -1 +0,0 @@
Subproject commit 17060e500a853a9b4ed860f246d3aa0a90258e31

2
external/tsschecker vendored

@ -1 +1 @@
Subproject commit d0541a62b75dfe7c37e4d2d6bab60b8c40b9e0b5
Subproject commit b9d193aa6e6d24421094873c830692d02d8b32f5

View file

@ -3,26 +3,33 @@
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objectVersion = 47;
objects = {
/* Begin PBXBuildFile section */
5669111D23B3D86E00C93279 /* libbz2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5669111C23B3D86E00C93279 /* libbz2.a */; };
5669111F23B3D88200C93279 /* libcrypto.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5669111E23B3D88200C93279 /* libcrypto.a */; };
5669112123B3D89B00C93279 /* libcurl.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 5669112023B3D89B00C93279 /* libcurl.tbd */; };
5669112323B3D89E00C93279 /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 5669112223B3D89E00C93279 /* libz.tbd */; };
5669112523B3D8B200C93279 /* libfragmentzip.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5669112423B3D8B200C93279 /* libfragmentzip.a */; };
5669112723B3D8BE00C93279 /* libgeneral.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5669112623B3D8BE00C93279 /* libgeneral.a */; };
5669112923B3D8CF00C93279 /* libimg4tool.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5669112823B3D8CE00C93279 /* libimg4tool.a */; };
5669112B23B3D8DA00C93279 /* libimobiledevice.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5669112A23B3D8DA00C93279 /* libimobiledevice.a */; };
5669112D23B3D8E200C93279 /* libipatcher.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5669112C23B3D8E200C93279 /* libipatcher.a */; };
5669112F23B3D8ED00C93279 /* libirecovery.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5669112E23B3D8ED00C93279 /* libirecovery.a */; };
5669113123B3D91B00C93279 /* libpartialzip-1.0.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5669113023B3D91B00C93279 /* libpartialzip-1.0.a */; };
5669113323B3D92B00C93279 /* libplist.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5669113223B3D92B00C93279 /* libplist.a */; };
5669113523B3D94300C93279 /* libzip.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5669113423B3D94300C93279 /* libzip.a */; };
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 */; };
878587B31D89D5D5008689F0 /* libzip.4.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 878587B21D89D5D5008689F0 /* libzip.4.dylib */; };
878587B71D89D637008689F0 /* libirecovery.2.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 878587B61D89D637008689F0 /* libirecovery.2.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 "; }; };
8799B0B31D89DAE7002F4D5F /* idevicerestore.c in Sources */ = {isa = PBXBuildFile; fileRef = 8785875C1D89D1C1008689F0 /* idevicerestore.c */; };
8799B0B41D89DAF6002F4D5F /* tss.c in Sources */ = {isa = PBXBuildFile; fileRef = 878587761D89D1C1008689F0 /* tss.c */; };
8799B0B51D89DAFF002F4D5F /* common.c in Sources */ = {isa = PBXBuildFile; fileRef = 878587511D89D1C1008689F0 /* common.c */; };
8799B0B61D89DAFF002F4D5F /* dfu.c in Sources */ = {isa = PBXBuildFile; fileRef = 878587531D89D1C1008689F0 /* dfu.c */; };
8799B0B71D89DAFF002F4D5F /* normal.c in Sources */ = {isa = PBXBuildFile; fileRef = 8785876C1D89D1C1008689F0 /* normal.c */; };
8799B0B81D89DAFF002F4D5F /* recovery.c in Sources */ = {isa = PBXBuildFile; fileRef = 8785876E1D89D1C1008689F0 /* recovery.c */; };
8799B0B91D89DB0D002F4D5F /* img3.c in Sources */ = {isa = PBXBuildFile; fileRef = 8785875E1D89D1C1008689F0 /* img3.c */; };
8799B0BB1D89DB12002F4D5F /* download.c in Sources */ = {isa = PBXBuildFile; fileRef = 878587551D89D1C1008689F0 /* download.c */; };
8799B0BB1D89DB12002F4D5F /* download.c in Sources */ = {isa = PBXBuildFile; fileRef = 878587551D89D1C1008689F0 /* download.c */; settings = {COMPILER_FLAGS = "-DPACKAGE_VERSION=\"\""; }; };
8799B0BC1D89DB27002F4D5F /* ipsw.c in Sources */ = {isa = PBXBuildFile; fileRef = 878587621D89D1C1008689F0 /* ipsw.c */; };
8799B0BD1D89DB27002F4D5F /* limera1n.c in Sources */ = {isa = PBXBuildFile; fileRef = 878587641D89D1C1008689F0 /* limera1n.c */; };
8799B0BE1D89DB27002F4D5F /* restore.c in Sources */ = {isa = PBXBuildFile; fileRef = 878587701D89D1C1008689F0 /* restore.c */; };
@ -33,17 +40,25 @@
8799B0C31D89DB4B002F4D5F /* socket.c in Sources */ = {isa = PBXBuildFile; fileRef = 878587721D89D1C1008689F0 /* socket.c */; };
8799B0C41D89DB55002F4D5F /* mbn.c in Sources */ = {isa = PBXBuildFile; fileRef = 8785876A1D89D1C1008689F0 /* mbn.c */; };
8799B0C51D89DB67002F4D5F /* locking.c in Sources */ = {isa = PBXBuildFile; fileRef = 878587671D89D1C1008689F0 /* locking.c */; };
8799B0C81D89E2BD002F4D5F /* img4tool.c in Sources */ = {isa = PBXBuildFile; fileRef = 878587901D89D1ED008689F0 /* img4tool.c */; settings = {COMPILER_FLAGS = "-D HAVE_CONFIG_H=1 "; }; };
8799B0C91D89E2C3002F4D5F /* img4.c in Sources */ = {isa = PBXBuildFile; fileRef = 8785878E1D89D1ED008689F0 /* img4.c */; };
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 */; };
8799B0CD1D89F7B9002F4D5F /* jsmn.c in Sources */ = {isa = PBXBuildFile; fileRef = 8785879A1D89D2BA008689F0 /* jsmn.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 */; };
87B517C3236EF36B009EAB8F /* ftab.c in Sources */ = {isa = PBXBuildFile; fileRef = 87B517C1236EF36B009EAB8F /* ftab.c */; };
87B517C6236EF3B0009EAB8F /* json_plist.c in Sources */ = {isa = PBXBuildFile; fileRef = 87B517C5236EF3B0009EAB8F /* json_plist.c */; };
87B517C9236EF3CD009EAB8F /* jsmn.c in Sources */ = {isa = PBXBuildFile; fileRef = 87B517C7236EF3CD009EAB8F /* jsmn.c */; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
8762F346236DF4D900F42FDB /* Embed Libraries */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 10;
files = (
);
name = "Embed Libraries";
runOnlyForDeploymentPostprocessing = 0;
};
878587411D89CFDC008689F0 /* CopyFiles */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
@ -56,6 +71,19 @@
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
5669111C23B3D86E00C93279 /* libbz2.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libbz2.a; path = ../../../../../usr/local/lib/libbz2.a; sourceTree = "<group>"; };
5669111E23B3D88200C93279 /* libcrypto.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libcrypto.a; path = ../../../../../usr/local/lib/libcrypto.a; sourceTree = "<group>"; };
5669112023B3D89B00C93279 /* libcurl.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libcurl.tbd; path = usr/lib/libcurl.tbd; sourceTree = SDKROOT; };
5669112223B3D89E00C93279 /* libz.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = usr/lib/libz.tbd; sourceTree = SDKROOT; };
5669112423B3D8B200C93279 /* libfragmentzip.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libfragmentzip.a; path = ../../../../../usr/local/lib/libfragmentzip.a; sourceTree = "<group>"; };
5669112623B3D8BE00C93279 /* libgeneral.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libgeneral.a; path = ../../../../../usr/local/lib/libgeneral.a; sourceTree = "<group>"; };
5669112823B3D8CE00C93279 /* libimg4tool.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libimg4tool.a; path = ../../../../../usr/local/lib/libimg4tool.a; sourceTree = "<group>"; };
5669112A23B3D8DA00C93279 /* libimobiledevice.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libimobiledevice.a; path = ../../../../../usr/local/lib/libimobiledevice.a; sourceTree = "<group>"; };
5669112C23B3D8E200C93279 /* libipatcher.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libipatcher.a; path = ../../../../../usr/local/lib/libipatcher.a; sourceTree = "<group>"; };
5669112E23B3D8ED00C93279 /* libirecovery.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libirecovery.a; path = ../../../../../usr/local/lib/libirecovery.a; sourceTree = "<group>"; };
5669113023B3D91B00C93279 /* libpartialzip-1.0.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libpartialzip-1.0.a"; path = "../../../../../usr/local/lib/libpartialzip-1.0.a"; sourceTree = "<group>"; };
5669113223B3D92B00C93279 /* libplist.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libplist.a; path = ../../../../../usr/local/lib/libplist.a; sourceTree = "<group>"; };
5669113423B3D94300C93279 /* libzip.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libzip.a; path = ../../../../../usr/local/lib/libzip.a; sourceTree = "<group>"; };
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 = "<group>"; };
8785874F1D89D1C1008689F0 /* asr.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = asr.c; sourceTree = "<group>"; };
@ -98,32 +126,21 @@
878587751D89D1C1008689F0 /* thread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = thread.h; sourceTree = "<group>"; };
878587761D89D1C1008689F0 /* tss.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tss.c; sourceTree = "<group>"; };
878587771D89D1C1008689F0 /* tss.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tss.h; sourceTree = "<group>"; };
8785878C1D89D1ED008689F0 /* all_img4tool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = all_img4tool.h; sourceTree = "<group>"; };
8785878E1D89D1ED008689F0 /* img4.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = img4.c; sourceTree = "<group>"; };
8785878F1D89D1ED008689F0 /* img4.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = img4.h; sourceTree = "<group>"; };
878587901D89D1ED008689F0 /* img4tool.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = img4tool.c; sourceTree = "<group>"; };
878587941D89D243008689F0 /* img4tool.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = img4tool.h; sourceTree = "<group>"; };
878587951D89D290008689F0 /* config.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = config.h; sourceTree = "<group>"; };
878587971D89D2BA008689F0 /* all_tsschecker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = all_tsschecker.h; sourceTree = "<group>"; };
878587981D89D2BA008689F0 /* download.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = download.c; sourceTree = "<group>"; };
878587991D89D2BA008689F0 /* download.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = download.h; sourceTree = "<group>"; };
8785879A1D89D2BA008689F0 /* jsmn.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = jsmn.c; sourceTree = "<group>"; };
8785879B1D89D2BA008689F0 /* jsmn.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsmn.h; sourceTree = "<group>"; };
8785879A1D89D2BA008689F0 /* jssy.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = jssy.c; path = ../external/jssy/jssy/jssy.c; sourceTree = "<group>"; };
8785879B1D89D2BA008689F0 /* jssy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = jssy.h; path = ../external/jssy/jssy/jssy.h; sourceTree = "<group>"; };
8785879F1D89D2BA008689F0 /* tsschecker.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tsschecker.c; sourceTree = "<group>"; };
878587A01D89D2BA008689F0 /* tsschecker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tsschecker.h; sourceTree = "<group>"; };
878587A61D89D56E008689F0 /* libplist.3.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libplist.3.dylib; path = ../../../../usr/local/lib/libplist.3.dylib; sourceTree = "<group>"; };
878587A81D89D578008689F0 /* libirecovery.1.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libirecovery.1.dylib; path = ../../../../usr/local/lib/libirecovery.1.dylib; sourceTree = "<group>"; };
878587AA1D89D590008689F0 /* libimobiledevice.6.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libimobiledevice.6.dylib; path = ../../../../usr/local/lib/libimobiledevice.6.dylib; sourceTree = "<group>"; };
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 = "<group>"; };
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 = "<group>"; };
878587B61D89D637008689F0 /* libirecovery.2.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libirecovery.2.dylib; path = ../../../../usr/local/lib/libirecovery.2.dylib; sourceTree = "<group>"; };
8799B0B01D89D99D002F4D5F /* futurerestore.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = futurerestore.cpp; sourceTree = "<group>"; };
8799B0B11D89D99D002F4D5F /* futurerestore.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = futurerestore.hpp; sourceTree = "<group>"; };
87F574C51E151D42008D5C4D /* libcrypto.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libcrypto.dylib; path = ../../../../usr/lib/libcrypto.dylib; sourceTree = "<group>"; };
87B517C1236EF36B009EAB8F /* ftab.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ftab.c; sourceTree = "<group>"; };
87B517C2236EF36B009EAB8F /* ftab.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ftab.h; sourceTree = "<group>"; };
87B517C4236EF3B0009EAB8F /* json_plist.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = json_plist.h; sourceTree = "<group>"; };
87B517C5236EF3B0009EAB8F /* json_plist.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = json_plist.c; sourceTree = "<group>"; };
87B517C7236EF3CD009EAB8F /* jsmn.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = jsmn.c; sourceTree = "<group>"; };
87B517C8236EF3CD009EAB8F /* jsmn.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsmn.h; sourceTree = "<group>"; };
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 = "<group>"; };
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 */
@ -133,14 +150,19 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
87F574D01E151F44008D5C4D /* libcrypto.dylib in Frameworks */,
87F574CB1E151E97008D5C4D /* libfragmentzip.0.dylib in Frameworks */,
878587B71D89D637008689F0 /* libirecovery.2.dylib in Frameworks */,
878587B31D89D5D5008689F0 /* libzip.4.dylib in Frameworks */,
878587AF1D89D5A5008689F0 /* libcurl.tbd in Frameworks */,
878587AD1D89D59E008689F0 /* libz.tbd in Frameworks */,
878587AB1D89D590008689F0 /* libimobiledevice.6.dylib in Frameworks */,
878587A71D89D56E008689F0 /* libplist.3.dylib in Frameworks */,
5669113323B3D92B00C93279 /* libplist.a in Frameworks */,
5669111D23B3D86E00C93279 /* libbz2.a in Frameworks */,
5669112523B3D8B200C93279 /* libfragmentzip.a in Frameworks */,
5669112923B3D8CF00C93279 /* libimg4tool.a in Frameworks */,
5669112D23B3D8E200C93279 /* libipatcher.a in Frameworks */,
5669112B23B3D8DA00C93279 /* libimobiledevice.a in Frameworks */,
5669112F23B3D8ED00C93279 /* libirecovery.a in Frameworks */,
5669113123B3D91B00C93279 /* libpartialzip-1.0.a in Frameworks */,
5669112723B3D8BE00C93279 /* libgeneral.a in Frameworks */,
5669112123B3D89B00C93279 /* libcurl.tbd in Frameworks */,
5669112323B3D89E00C93279 /* libz.tbd in Frameworks */,
5669111F23B3D88200C93279 /* libcrypto.a in Frameworks */,
5669113523B3D94300C93279 /* libzip.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -150,14 +172,6 @@
8785873A1D89CFDC008689F0 = {
isa = PBXGroup;
children = (
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 */,
@ -175,7 +189,6 @@
878587451D89CFDC008689F0 /* futurerestore */ = {
isa = PBXGroup;
children = (
878587951D89D290008689F0 /* config.h */,
8785874D1D89D1A4008689F0 /* external */,
8799B0B11D89D99D002F4D5F /* futurerestore.hpp */,
8799B0B01D89D99D002F4D5F /* futurerestore.cpp */,
@ -188,7 +201,6 @@
isa = PBXGroup;
children = (
878587961D89D2BA008689F0 /* tsschecker */,
8785878B1D89D1ED008689F0 /* img4tool */,
8785874E1D89D1C1008689F0 /* idevicerestore */,
);
name = external;
@ -216,6 +228,12 @@
8785875F1D89D1C1008689F0 /* img3.h */,
878587601D89D1C1008689F0 /* img4.c */,
878587611D89D1C1008689F0 /* img4.h */,
87B517C5236EF3B0009EAB8F /* json_plist.c */,
87B517C4236EF3B0009EAB8F /* json_plist.h */,
87B517C1236EF36B009EAB8F /* ftab.c */,
87B517C2236EF36B009EAB8F /* ftab.h */,
87B517C7236EF3CD009EAB8F /* jsmn.c */,
87B517C8236EF3CD009EAB8F /* jsmn.h */,
878587621D89D1C1008689F0 /* ipsw.c */,
878587631D89D1C1008689F0 /* ipsw.h */,
878587641D89D1C1008689F0 /* limera1n.c */,
@ -242,27 +260,13 @@
path = external/idevicerestore/src;
sourceTree = SOURCE_ROOT;
};
8785878B1D89D1ED008689F0 /* img4tool */ = {
isa = PBXGroup;
children = (
8785878C1D89D1ED008689F0 /* all_img4tool.h */,
8785878F1D89D1ED008689F0 /* img4.h */,
8785878E1D89D1ED008689F0 /* img4.c */,
878587941D89D243008689F0 /* img4tool.h */,
878587901D89D1ED008689F0 /* img4tool.c */,
);
name = img4tool;
path = external/img4tool/img4tool;
sourceTree = SOURCE_ROOT;
};
878587961D89D2BA008689F0 /* tsschecker */ = {
isa = PBXGroup;
children = (
878587971D89D2BA008689F0 /* all_tsschecker.h */,
878587991D89D2BA008689F0 /* download.h */,
878587981D89D2BA008689F0 /* download.c */,
8785879B1D89D2BA008689F0 /* jsmn.h */,
8785879A1D89D2BA008689F0 /* jsmn.c */,
8785879B1D89D2BA008689F0 /* jssy.h */,
8785879A1D89D2BA008689F0 /* jssy.c */,
878587A01D89D2BA008689F0 /* tsschecker.h */,
8785879F1D89D2BA008689F0 /* tsschecker.c */,
);
@ -273,11 +277,22 @@
87F574C21E151CDE008D5C4D /* Frameworks */ = {
isa = PBXGroup;
children = (
87F574CE1E151F11008D5C4D /* libSystem.tbd */,
87F574CC1E151EF8008D5C4D /* libcorecrypto.tbd */,
87F574CA1E151E97008D5C4D /* libfragmentzip.0.dylib */,
5669111C23B3D86E00C93279 /* libbz2.a */,
87F574C71E151DA6008D5C4D /* libcommonCrypto.tbd */,
87F574C51E151D42008D5C4D /* libcrypto.dylib */,
87F574CC1E151EF8008D5C4D /* libcorecrypto.tbd */,
5669111E23B3D88200C93279 /* libcrypto.a */,
5669112023B3D89B00C93279 /* libcurl.tbd */,
5669112223B3D89E00C93279 /* libz.tbd */,
5669112623B3D8BE00C93279 /* libgeneral.a */,
5669112423B3D8B200C93279 /* libfragmentzip.a */,
5669112823B3D8CE00C93279 /* libimg4tool.a */,
5669112A23B3D8DA00C93279 /* libimobiledevice.a */,
5669112C23B3D8E200C93279 /* libipatcher.a */,
5669112E23B3D8ED00C93279 /* libirecovery.a */,
5669113023B3D91B00C93279 /* libpartialzip-1.0.a */,
5669113223B3D92B00C93279 /* libplist.a */,
87F574CE1E151F11008D5C4D /* libSystem.tbd */,
5669113423B3D94300C93279 /* libzip.a */,
);
name = Frameworks;
sourceTree = "<group>";
@ -292,6 +307,7 @@
8785873F1D89CFDC008689F0 /* Sources */,
878587401D89CFDC008689F0 /* Frameworks */,
878587411D89CFDC008689F0 /* CopyFiles */,
8762F346236DF4D900F42FDB /* Embed Libraries */,
);
buildRules = (
);
@ -308,7 +324,7 @@
8785873B1D89CFDC008689F0 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0730;
LastUpgradeCheck = 1130;
ORGANIZATIONNAME = tihmstar;
TargetAttributes = {
878587421D89CFDC008689F0 = {
@ -317,8 +333,8 @@
};
};
buildConfigurationList = 8785873E1D89CFDC008689F0 /* Build configuration list for PBXProject "futurerestore" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
compatibilityVersion = "Xcode 6.3";
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
@ -342,26 +358,26 @@
8799B0B41D89DAF6002F4D5F /* tss.c in Sources */,
8799B0C01D89DB38002F4D5F /* fdr.c in Sources */,
8799B0BC1D89DB27002F4D5F /* ipsw.c in Sources */,
87B517C3236EF36B009EAB8F /* ftab.c in Sources */,
8799B0CC1D89F7B9002F4D5F /* download.c in Sources */,
8799B0B91D89DB0D002F4D5F /* img3.c in Sources */,
8799B0B51D89DAFF002F4D5F /* common.c in Sources */,
8799B0C41D89DB55002F4D5F /* mbn.c in Sources */,
8799B0B81D89DAFF002F4D5F /* recovery.c in Sources */,
8799B0B31D89DAE7002F4D5F /* idevicerestore.c in Sources */,
8799B0C81D89E2BD002F4D5F /* img4tool.c in Sources */,
8799B0BB1D89DB12002F4D5F /* download.c in Sources */,
8799B0B71D89DAFF002F4D5F /* normal.c in Sources */,
8799B0CD1D89F7B9002F4D5F /* jsmn.c in Sources */,
87B517C9236EF3CD009EAB8F /* jsmn.c in Sources */,
8799B0C31D89DB4B002F4D5F /* socket.c in Sources */,
8799B0C21D89DB46002F4D5F /* thread.c in Sources */,
8799B0B61D89DAFF002F4D5F /* dfu.c in Sources */,
8799B0BD1D89DB27002F4D5F /* limera1n.c in Sources */,
8799B0C51D89DB67002F4D5F /* locking.c in Sources */,
878587471D89CFDC008689F0 /* main.cpp in Sources */,
87B517C6236EF3B0009EAB8F /* json_plist.c in Sources */,
8799B0BF1D89DB38002F4D5F /* asr.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 */,
);
@ -379,13 +395,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 = "-";
@ -407,6 +433,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
INSTALL_PATH = /usr/local/bin;
MACOSX_DEPLOYMENT_TARGET = 10.11;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
@ -423,13 +450,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 = "-";
@ -445,6 +482,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
INSTALL_PATH = /usr/local/bin;
MACOSX_DEPLOYMENT_TARGET = 10.11;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = macosx;
@ -455,16 +493,23 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = YES;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
"IDEVICERESTORE_NOMAIN=1",
"CUSTOM_LOGGING=1",
"HAVE_REALPATH=1",
);
HEADER_SEARCH_PATHS = "";
LIBRARY_SEARCH_PATHS = (
/usr/local/lib,
/usr/lib,
/usr/local/opt/openssl/lib,
"$(SDKROOT)/usr/lib/system",
/opt/local/lib,
);
OTHER_CFLAGS = "";
OTHER_CFLAGS = "-DHAVE_LIBIPATCHER";
PRODUCT_NAME = "$(TARGET_NAME)";
USER_HEADER_SEARCH_PATHS = "/usr/local/include /opt/local/include";
USER_HEADER_SEARCH_PATHS = "/usr/local/opt/openssl/include /usr/local/include $(SRCROOT)/external/libgeneral/include $(SRCROOT)/external/tsschecker/external/jssy/jssy $(SRCROOT)/external/idevicerestore/src";
};
name = Debug;
};
@ -476,12 +521,12 @@
LIBRARY_SEARCH_PATHS = (
/usr/local/lib,
/usr/lib,
/usr/local/opt/openssl/lib,
"$(SDKROOT)/usr/lib/system",
/opt/local/lib,
);
OTHER_CFLAGS = "";
OTHER_CFLAGS = "-DHAVE_LIBIPATCHER";
PRODUCT_NAME = "$(TARGET_NAME)";
USER_HEADER_SEARCH_PATHS = "/usr/local/include /opt/local/include";
USER_HEADER_SEARCH_PATHS = "/usr/local/opt/openssl/include /usr/local/include $(SRCROOT)/external/libgeneral/include $(SRCROOT)/external/tsschecker/external/jssy/jssy $(SRCROOT)/external/idevicerestore/src";
};
name = Release;
};

View file

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>

View file

@ -1,7 +1,12 @@
AM_CFLAGS = $(libplist_CFLAGS) $(libzip_CFLAGS) $(libimobiledevice_CFLAGS) $(libfragmentzip_CFLAGS) $(libirecovery_CFLAGS) -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 = -I$(top_srcdir)/external/libgeneral/include -I$(top_srcdir)/external/tsschecker/external/jssy/jssy -I$(top_srcdir)/external/tsschecker/tsschecker -I$(top_srcdir)/external/idevicerestore/src $(libplist_CFLAGS) $(libzip_CFLAGS) $(libimobiledevice_CFLAGS) $(libfragmentzip_CFLAGS) $(libirecovery_CFLAGS) $(libimg4tool_CFLAGS) $(libgeneral_CFLAGS)
AM_LDFLAGS = $(libplist_LIBS) $(libzip_LIBS) $(libimobiledevice_LIBS) $(libfragmentzip_LIBS) $(libirecovery_LIBS) $(libimg4tool_LIBS) $(libgeneral_LIBS)
bin_PROGRAMS = futurerestore
if HAVE_LIBIPATCHER
AM_LDFLAGS += $(libipatcher_LIBS)
AM_CFLAGS += $(libipatcher_CFLAGS)
endif
bin_PROGRAMS = futurerestore
futurerestore_CXXFLAGS = $(AM_CFLAGS)
futurerestore_LDADD = $(top_srcdir)/external/idevicerestore/src/libidevicerestore.la $(top_srcdir)/external/img4tool/img4tool/libimg4tool.la $(top_srcdir)/external/tsschecker/tsschecker/libtsschecker.la $(AM_LDFLAGS)
futurerestore_LDADD = $(top_srcdir)/external/idevicerestore/src/libidevicerestore.la $(top_srcdir)/external/tsschecker/tsschecker/libtsschecker.la $(top_srcdir)/external/tsschecker/tsschecker/libjssy.a $(AM_LDFLAGS)
futurerestore_SOURCES = futurerestore.cpp main.cpp

View file

@ -1,28 +0,0 @@
//
// config.h
// futurerestore
//
// Created by tihmstar on 04.09.16.
// Copyright © 2016 tihmstar. All rights reserved.
//
#ifndef config_h
#define config_h
#define IMG4TOOL_NOMAIN
#define NO_DEBUG_PLIST
#define NO_GENERATE_GUID
//idevicerestore config
#define IDEVICERESTORE_NOMAIN
#define PACKAGE_URL "http://libimobiledevice.org"
#undef VERSION_COMMIT_SHA
#undef VERSION_COMMIT_COUNT
#define VERSION_COMMIT_COUNT_FUTURERESTORE "undefined version number"
#define VERSION_COMMIT_SHA_FUTURERESTORE "undefined version commit"
#endif /* config_h */

File diff suppressed because it is too large Load diff

View file

@ -9,12 +9,18 @@
#ifndef futurerestore_hpp
#define futurerestore_hpp
#include "config.h"
//make sure WIN32 is defined if compiling for windows
#if defined _WIN32 || defined __CYGWIN__
#ifndef WIN32
#define WIN32
#endif
#endif
#include <stdio.h>
#include <functional>
#include <vector>
#include "idevicerestore.h"
#include "jsmn.h"
#include <jssy.h>
#include <plist/plist.h>
using namespace std;
@ -27,41 +33,58 @@ public:
ptr_smart(T p, function<void(T)> ptr_free){static_assert(is_pointer<T>(), "error: this is for pointers only\n"); _p = p;_ptr_free = ptr_free;}
ptr_smart(T p){_p = p;}
ptr_smart(){_p = NULL;}
T operator=(T p){return _p = p;}
ptr_smart(ptr_smart &&p){ _p = p._p; _ptr_free = p._ptr_free; p._p = NULL; p._ptr_free = NULL;}
ptr_smart& operator =(ptr_smart &&p){_p = p._p; _ptr_free = p._ptr_free; p._p = NULL; p._ptr_free = NULL; return *this;}
T operator =(T p){ _p = p; return _p;}
T operator =(T &p){_p = p; p = NULL; return _p;}
T *operator&(){return &_p;}
explicit operator const T() const {return _p;}
operator const void*() const {return _p;}
~ptr_smart(){if (_p) (_ptr_free) ? _ptr_free(_p) : free((void*)_p);}
};
class futurerestore {
struct idevicerestore_client_t* _client;
char *_ibootBuild = NULL;
bool _didInit = false;
vector<plist_t> _aptickets;
vector<char *>_im4ms;
vector<pair<char *, size_t>>_im4ms;
int _foundnonce = -1;
bool _isUpdateInstall = false;
bool _isPwnDfu = false;
char *_firmwareJson = NULL;
jsmntok_t *_firmwareTokens = NULL;;
jssytok_t *_firmwareTokens = NULL;;
char *__latestManifest = NULL;
char *__latestFirmwareUrl = NULL;
plist_t _sepbuildmanifest = NULL;
plist_t _basebandbuildmanifest = NULL;
const char *_basebandPath;
const char *_basebandPath = NULL;;
const char *_sepbuildmanifestPath = NULL;
const char *_basebandbuildmanifestPath = NULL;
bool _enterPwnRecoveryRequested = false;
bool _rerestoreiOS9 = false;
//methods
void enterPwnRecovery(plist_t build_identity, std::string bootargs = "");
public:
futurerestore();
futurerestore(bool isUpdateInstall = false, bool isPwnDfu = false);
bool init();
int getDeviceMode(bool reRequest);
uint64_t getDeviceEcid();
void putDeviceIntoRecovery();
void setAutoboot(bool val);
void exitRecovery();
void waitForNonce();
void waitForNonce(vector<const char *>nonces, size_t nonceSize);
void loadAPTickets(const vector<const char *> &apticketPaths);
char *getiBootBuild();
plist_t nonceMatchesApTickets();
const char *nonceMatchesIM4Ms();
std::pair<const char *,size_t> nonceMatchesIM4Ms();
void loadFirmwareTokens();
const char *getDeviceModelNoCopy();
@ -75,27 +98,28 @@ public:
void setBasebandManifestPath(const char *basebandManifestPath);
void loadSep(const char *sepPath);
void setBasebandPath(const char *basebandPath);
bool isUpdateInstall(){return _isUpdateInstall;};
plist_t sepManifest(){return _sepbuildmanifest;};
plist_t basebandManifest(){return _basebandbuildmanifest;};
const char *sepManifestPath(){return _sepbuildmanifestPath;};
const char *basebandManifestPath(){return _basebandbuildmanifestPath;};
bool is32bit(){return !is_image4_supported(_client);};
uint64_t getBasebandGoldCertIDFromDevice();
int doRestore(const char *ipsw, bool noerase);
void doRestore(const char *ipsw);
int doJustBoot(const char *ipsw, std::string bootargs = "");
~futurerestore();
static char *getNonceFromIM4M(const char* im4m, size_t *nonceSize);
static char *getNonceFromAPTicket(const char* apticketPath);
static std::pair<const char *,size_t> getRamdiskHashFromSCAB(const char* scab, size_t scabSize);
static std::pair<const char *,size_t> getNonceFromSCAB(const char* scab, size_t scabSize);
static uint64_t getEcidFromSCAB(const char* scab, size_t scabSize);
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, const char *model, int isUpdateInstall);
static std::string getGeneratorFromSHSH2(const plist_t shsh2);
};
#endif /* futurerestore_hpp */

View file

@ -1,4 +1,4 @@
//
// main.cpp
// futurerestore
//
@ -12,13 +12,24 @@
#include <unistd.h>
#include <vector>
#include "futurerestore.hpp"
#include "all_tsschecker.h"
extern "C"{
#include "tsschecker.h"
#undef VERSION_COMMIT_SHA
#undef VERSION_COMMIT_COUNT
};
#include "config.h"
#include <libgeneral/macros.h>
#ifdef HAVE_LIBIPATCHER
#include <libipatcher/libipatcher.hpp>
#endif
#define safeFree(buf) if (buf) free(buf), buf = NULL
#define safePlistFree(buf) if (buf) plist_free(buf), buf = NULL
#ifdef WIN32
#include <windows.h>
#ifndef ENABLE_VIRTUAL_TERMINAL_PROCESSING
#define ENABLE_VIRTUAL_TERMINAL_PROCESSING 0x0004
#endif
#endif
static struct option longopts[] = {
{ "apticket", required_argument, NULL, 't' },
@ -29,9 +40,14 @@ static struct option longopts[] = {
{ "wait", no_argument, NULL, 'w' },
{ "update", no_argument, NULL, 'u' },
{ "debug", no_argument, NULL, 'd' },
{ "exit-recovery", no_argument, NULL, 'e' },
{ "latest-sep", no_argument, NULL, '0' },
{ "latest-baseband", no_argument, NULL, '1' },
{ "no-baseband", no_argument, NULL, '2' },
{ "no-baseband", no_argument, NULL, '2' },
#ifdef HAVE_LIBIPATCHER
{ "use-pwndfu", no_argument, NULL, '3' },
{ "just-boot", optional_argument, NULL, '4' },
#endif
{ NULL, 0, NULL, 0 }
};
@ -40,35 +56,62 @@ static struct option longopts[] = {
#define FLAG_LATEST_SEP 1 << 2
#define FLAG_LATEST_BASEBAND 1 << 3
#define FLAG_NO_BASEBAND 1 << 4
#define FLAG_IS_PWN_DFU 1 << 5
void cmd_help(){
printf("Usage: futurerestore [OPTIONS] IPSW\n");
printf("Allows restoring nonmatching iOS/Sep/Baseband\n\n");
printf("Usage: futurerestore [OPTIONS] iPSW\n");
printf("Allows restoring to non-matching firmware with custom SEP+baseband\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\tDO NOT 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\tShow all code, use to save a log for debug testing\n");
printf(" -e, --exit-recovery\t\tExit recovery mode and quit\n");
printf(" -t, --apticket PATH\t\tApticket used for restoring\n");
#ifdef HAVE_LIBIPATCHER
printf("\nOptions for downgrading with Odysseus:\n");
printf(" --use-pwndfu\t\tRestoring devices with Odysseus method. Device needs to be in pwned DFU mode already\n");
printf(" --just-boot=\"-v\"\t\tTethered booting the device from pwned DFU mode. You can optionally set boot-args\n");
#endif
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");
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");
printf(" -w, --wait\t\t\tkeep rebooting until nonce matches APTicket\n");
printf(" -u, --update\t\t\tupdate instead of erase install\n");
printf(" --latest-sep\t\tuse latest signed sep instead of manually specifying one(may cause bad restore)\n");
printf(" --latest-baseband\t\tse 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 baseband (eg iPod or some wifi only iPads)\n");
printf("\n");
printf(" -p, --baseband-manifest PATH\tBuildManifest for requesting baseband ticket\n");
printf(" --no-baseband\t\tSkip checks and don't flash baseband\n");
printf(" \t\tOnly use this for device without a baseband (eg. iPod touch or some Wi-Fi only iPads)\n\n");
}
#ifdef WIN32
DWORD termFlags;
HANDLE handle = GetStdHandle(STD_OUTPUT_HANDLE);
if (GetConsoleMode(handle, &termFlags))
SetConsoleMode(handle, termFlags | ENABLE_VIRTUAL_TERMINAL_PROCESSING);
#endif
using namespace std;
int main(int argc, const char * argv[]) {
#define reterror(code,a ...) do {error(a); err = code; goto error;} while (0)
using namespace tihmstar;
int main_r(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 " - " VERSION_COMMIT_COUNT "\n");
#ifdef HAVE_LIBIPATCHER
printf("%s\n",libipatcher::version());
printf("Odysseus for 32-bit support: yes\n");
printf("Odysseus for 64-bit support: %s\n",(libipatcher::has64bitSupport() ? "yes" : "no"));
#else
printf("Odysseus support: no\n");
#endif
int optindex = 0;
int opt = 0;
long flags = 0;
bool exitRecovery = false;
int isSepManifestSigned = 0;
int isBasebandSigned = 0;
@ -78,6 +121,7 @@ int main(int argc, const char * argv[]) {
const char *basebandManifestPath = NULL;
const char *sepPath = NULL;
const char *sepManifestPath = NULL;
const char *bootargs = NULL;
vector<const char*> apticketPaths;
@ -88,8 +132,8 @@ int main(int argc, const char * argv[]) {
cmd_help();
return -1;
}
while ((opt = getopt_long(argc, (char* const *)argv, "ht:b:p:s:m:wud01", longopts, &optindex)) > 0) {
while ((opt = getopt_long(argc, (char* const *)argv, "ht:b:p:s:m:wude0123", longopts, &optindex)) > 0) {
switch (opt) {
case 't': // long option: "apticket"; can be called as short option
apticketPaths.push_back(optarg);
@ -97,7 +141,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
@ -121,6 +165,18 @@ int main(int argc, const char * argv[]) {
case '2': // long option: "no-baseband";
flags |= FLAG_NO_BASEBAND;
break;
#ifdef HAVE_LIBIPATCHER
case '3': // long option: "use-pwndfu";
flags |= FLAG_IS_PWN_DFU;
break;
case '4': // long option: "just-boot";
bootargs = (optarg) ? optarg : "";
break;
break;
#endif
case 'e': // long option: "exit-recovery"; can be called as short option
exitRecovery = true;
break;
case 'd': // long option: "debug"; can be called as short option
idevicerestore_debug = 1;
break;
@ -129,13 +185,16 @@ int main(int argc, const char * argv[]) {
return -1;
}
}
if (argc-optind == 1) {
argc -= optind;
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");
info("User requested to only wait for ApNonce to match, but not for actually restoring\n");
}else if (exitRecovery){
info("Exiting to recovery mode\n");
}else{
error("argument parsing failed! agrc=%d optind=%d\n",argc,optind);
if (idevicerestore_debug){
@ -146,17 +205,28 @@ int main(int argc, const char * argv[]) {
return -5;
}
futurerestore client;
if (!client.init()) reterror(-3,"can't init, no device found\n");
futurerestore client(flags & FLAG_UPDATE, flags & FLAG_IS_PWN_DFU);
retassure(client.init(),"can't init, no device found\n");
printf("futurerestore init done\n");
retassure(!bootargs || (flags & FLAG_IS_PWN_DFU),"--just-boot requires --use-pwndfu\n");
if (exitRecovery) {
client.exitRecovery();
info("Done\n");
return 0;
}
try {
if (apticketPaths.size()) client.loadAPTickets(apticketPaths);
if (!((apticketPaths.size() && ipsw)
&& ((basebandPath && basebandManifestPath) || ((flags & FLAG_LATEST_BASEBAND) || (flags & FLAG_NO_BASEBAND)))
&& ((sepPath && sepManifestPath) || (flags & FLAG_LATEST_SEP)))) {
if (!(
((apticketPaths.size() && ipsw)
&& ((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))
)) {
if (!(flags & FLAG_WAIT) || ipsw){
error("missing argument\n");
cmd_help();
@ -168,53 +238,55 @@ int main(int argc, const char * argv[]) {
}
goto error;
}
devVals.deviceModel = (char*)client.getDeviceModelNoCopy();
devVals.deviceBoard = (char*)client.getDeviceBoardNoCopy();
if (flags & FLAG_LATEST_SEP){
info("user specified to use latest signed sep\n");
client.loadLatestSep();
if (bootargs){
}else{
client.loadSep(sepPath);
client.setSepManifestPath(sepManifestPath);
}
versVals.basebandMode = kBasebandModeWithoutBaseband;
if (!(isSepManifestSigned = isManifestSignedForDevice(sepManifestPath, &devVals, &versVals))){
reterror(-3,"sep firmware isn't signed\n");
}
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;
printf("continuing restore in ");
while (c) {
printf("%d ",c--);
fflush(stdout);
sleep(1);
}
printf("\n");
}else{
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{
client.setBasebandPath(basebandPath);
client.setBasebandManifestPath(basebandManifestPath);
printf("Did set sep+baseband path and firmware\n");
devVals.deviceModel = (char*)client.getDeviceModelNoCopy();
devVals.deviceBoard = (char*)client.getDeviceBoardNoCopy();
if (flags & FLAG_LATEST_SEP){
info("user specified to use latest signed SEP (WARNING, THIS CAN CAUSE A NON-WORKING RESTORE)\n");
client.loadLatestSep();
}else if (!client.is32bit()){
client.loadSep(sepPath);
client.setSepManifestPath(sepManifestPath);
}
versVals.basebandMode = kBasebandModeOnlyBaseband;
if (!(devVals.bbgcid = client.getBasebandGoldCertIDFromDevice())){
printf("[WARNING] using tsschecker's fallback to get BasebandGoldCertID. This might result in invalid baseband signing status information\n");
versVals.basebandMode = kBasebandModeWithoutBaseband;
if (!client.is32bit() && !(isSepManifestSigned = isManifestSignedForDevice(client.sepManifestPath(), &devVals, &versVals))){
reterror("SEP firmware doesn't signed\n");
}
if (!(isBasebandSigned = isManifestSignedForDevice(basebandManifestPath, &devVals, &versVals))) {
reterror(-3,"baseband firmware isn't signed\n");
if (flags & FLAG_NO_BASEBAND){
printf("\nWARNING: user specified is 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 = 10;
printf("continuing restore in ");
while (c) {
printf("%d ",c--);
fflush(stdout);
sleep(1);
}
printf("\n");
}else{
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{
client.setBasebandPath(basebandPath);
client.setBasebandManifestPath(basebandManifestPath);
printf("Did set SEP+baseband path and firmware\n");
}
versVals.basebandMode = kBasebandModeOnlyBaseband;
if (!(devVals.bbgcid = client.getBasebandGoldCertIDFromDevice())){
printf("[WARNING] using tsschecker's fallback to get BasebandGoldCertID. This might result in invalid baseband signing status information\n");
}
if (!(isBasebandSigned = isManifestSignedForDevice(client.basebandManifestPath(), &devVals, &versVals))) {
reterror("baseband firmware doesn't signed\n");
}
}
}
client.putDeviceIntoRecovery();
if (flags & FLAG_WAIT){
client.waitForNonce();
@ -226,16 +298,34 @@ int main(int argc, const char * argv[]) {
}
try {
res = client.doRestore(ipsw, flags & FLAG_UPDATE);
} catch (int error) {
if (error == -20) error("maybe you forgot -w ?\n");
err = error;
if (bootargs)
client.doJustBoot(ipsw,bootargs);
else
client.doRestore(ipsw);
printf("Done: restoring succeeded!\n");
} catch (tihmstar::exception &e) {
e.dump();
printf("Done: restoring failed!\n");
}
cout << "Done: restoring "<< (!res ? "succeeded" : "failed")<<"." <<endl;
error:
if (err) cout << "Failed with errorcode="<<err << endl;
if (err){
printf("Failed with error code=%d\n",err);
}
return err;
#undef reterror
}
int main(int argc, const char * argv[]) {
#ifdef DEBUG
return main_r(argc, argv);
#else
try {
return main_r(argc, argv);
} catch (tihmstar::exception &e) {
printf("%s: failed with exception:\n",PACKAGE_NAME);
e.dump();
return e.code();
}
#endif
}

View file

@ -1,3 +0,0 @@
#!/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