Skip to content

Commit

Permalink
Windows Compatibilty now!
Browse files Browse the repository at this point in the history
  • Loading branch information
kasiimh1 committed Sep 8, 2019
1 parent 7fd0729 commit fd2d514
Show file tree
Hide file tree
Showing 8 changed files with 189 additions and 14 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,9 @@ idevice_id
ideviceenterrecovery
ideviceinfo
futurerestore
*.dll
windows/SupportFiles/igetnonce.exe
windows/SupportFiles/ideviceinfo.exe
windows/SupportFiles/ideviceenterrecovery.exe
windows/SupportFiles/futurerestore.exe
windows/SupportFiles/tsschecker.exe
46 changes: 32 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
UPDATE v0.6 - SaveMe The Easiest SHSH saver for macOS
UPDATE v0.7 - SaveMe The Easiest SHSH saver for macOS and now Windows!

Requirements before using
Requirements before using for Windows
- install iTunes

Requirements before using for macOS
- install brew
After installing brew run the following commands

Expand All @@ -10,17 +13,32 @@ After installing brew run the following commands
This should fix issues when not displaying device info

New in this update
1. Fixes wrong ECID and saving path
2. Adds new folder structure when saving tickets (unique per device and firmware)
3. Removed irecovery as it didn't work for some users on High Sierra
4. Switched back to igetnonce
5. Detects Processor Type ie A12(X) or not
6. If non A12(X) device it checks the generated nonce against Chimera's and Unc0vers default generators
7. Displays saved ticket path
8. Migrated to FutureRestore for exiting Recovery Mode as irecovery was removed as mentioned above
9. Biggest feature last, now you're able to check saved Ticket against device's generator with FutureRestore

How to use
1. Added Windows Support!
2. Fixes wrong ECID and saving path
3. Adds new folder structure when saving tickets (unique per device and firmware)
4. Removed irecovery as it didn't work for some users on High Sierra
5. Switched back to igetnonce
6. Detects Processor Type ie A12(X) or not
7. If non A12(X) device it checks the generated nonce against Chimera's and Unc0vers default generators
8. Displays saved ticket path
9. Migrated to FutureRestore for exiting Recovery Mode as irecovery was removed as mentioned above
10. Biggest feature last, now you're able to check saved Ticket against device's generator with FutureRestore

How to use for Windows
1. Download from this link
2. Save and extract the file to your desktop
3. open CMD or something similar
4. change directory to your desktop with this command "cd Desktop/"
5. Start typing Sav... and press TAB it should auto fill the remaining characters
4. connect your device and press enter
5. wait for it to reboot into recovery mode and press enter
6. enter the iOS version (Non OTA currently signed firmwares only) and press enter
7. wait for file to be saved and press enter again once it appears in your folder where you downloaded the program to
8. read the screen and see if the ticket matches the generator set on device
9. wait for it to reboot
10. Enjoy your newly saved tickets for future use

How to use for macOS
1. Download from this link
2. chmod +x the file if it says permission denied
3. open the binary in terminal
Expand Down Expand Up @@ -48,8 +66,8 @@ Uses the following tools
- FutureRestore https://github.com/s0uthwest/futurerestore
- igetnonce https://github.com/s0uthwest/igetnonce
- libimobiledevice - ideviceenterrecovery, ideviceinfo https://github.com/libimobiledevice
- libimobiledevice Windows - ideviceenterrecovery, ideviceinfo https://github.com/Devjam81/libimobile2019
- tsschecker https://github.com/s0uthwest/tsschecker

Future Updates?
- I could possibly compile this for Windows users if that's something you guys would like
- img4tool - check if the saved ticket is valid
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
151 changes: 151 additions & 0 deletions windows/SaveMe.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
import subprocess
import os
import sys
import glob

#requires
#brew install --HEAD usbmuxd brew install --HEAD libimobiledevice brew install --HEAD ideviceinstaller

frozen = 'not'
if getattr(sys, 'frozen', False):
# we are running in a bundle
frozen = 'ever so'
bundle_dir = sys._MEIPASS
else:
# we are running in a normal Python environment
bundle_dir = os.path.dirname(os.path.abspath(__file__))

udid = ''
ecid = ''
boardid = ''
deviceid = ''
apnonce = ''
iosversion = 0

hashes = '27325c8258be46e69d9ee57fa9a8fbc28b873df434e5e702a8b27999551138ae','3a88b7c3802f2f0510abc432104a15ebd8bd7154' ,'15400076bc4c35a7c8caefdcae5bda69c140a11bce870548f0862aac28c194cc','603be133ff0bdfa0f83f21e74191cf6770ea43bb'

savePath = os.getcwd()

if (os.path.isdir(savePath + '/SaveMe') is False):
try:
os.mkdir(savePath + '/SaveMe')
except FileExistsError:
print('\n\n[*] Skipping creating SaveMe folder as it already exists')

savePath = savePath + '/SaveMe'

os.chdir(bundle_dir)

print('[*] Connect Device To Start..')
input('[*] Press ENTER when Device is connected > ')
os.chdir(os.getcwd() + '/SupportFiles/')

popen = subprocess.Popen('ideviceinfo.exe | findstr UniqueDeviceID: ', shell = True, stdout=subprocess.PIPE,stderr=subprocess.PIPE, encoding='utf8')
communicateRes = popen.communicate()
udid, stdErrValue = communicateRes
udid = udid.strip()
udid = udid.replace('UniqueDeviceID: ','')

popen = subprocess.Popen('ideviceinfo.exe | findstr UniqueChipID: ', shell = True, stdout=subprocess.PIPE,stderr=subprocess.PIPE, encoding='utf8')
communicateRes = popen.communicate()
ecid, stdErrValue = communicateRes
ecid = ecid.strip()
ecid = ecid.replace('UniqueChipID: ','')

popen = subprocess.Popen('ideviceinfo.exe | findstr HardwarePlatform: ', shell = True, stdout=subprocess.PIPE,stderr=subprocess.PIPE, encoding='utf8')
communicateRes = popen.communicate()
platform, stdErrValue = communicateRes
platform = platform.strip()
platform = platform.replace('HardwarePlatform: ','')

popen = subprocess.Popen('ideviceinfo.exe | findstr ProductType: ', shell = True, stdout=subprocess.PIPE,stderr=subprocess.PIPE, encoding='utf8')
communicateRes = popen.communicate()
deviceid, stdErrValue = communicateRes
deviceid = deviceid.strip()
deviceid = deviceid.replace('ProductType: ','')

popen = subprocess.Popen('ideviceinfo.exe | findstr HardwareModel: ', shell = True, stdout=subprocess.PIPE,stderr=subprocess.PIPE, encoding='utf8')
communicateRes = popen.communicate()
boardid, stdErrValue = communicateRes
boardid = boardid.strip()
boardid = boardid.replace('HardwareModel: ','')

popen = subprocess.Popen('ideviceenterrecovery.exe %s' %udid, shell = True, stdout=subprocess.PIPE,stderr=subprocess.PIPE, encoding='utf8')
communicateRes = popen.communicate()
enterRecovery, stdErrValue = communicateRes

print('[*] ' + enterRecovery)
input('[*] Press ENTER when Device is in Recovery Mode > ')

popen = subprocess.Popen('igetnonce.exe', stdout=subprocess.PIPE,stderr=subprocess.PIPE, encoding='utf8')
communicateRes = popen.communicate()
igetNonceOuput, stdErrValue = communicateRes
igetNonceOuput = igetNonceOuput.split('\n')

for s in igetNonceOuput:
if s.startswith('ApNonce='):
apnonce = s
apnonce = apnonce.replace('ApNonce=','')

if (platform.find('t8020') != -1 or platform.find('t8027') != -1):
print('[*] Detected A12(X) Device')

else:
for x in hashes:
if (apnonce == x) is True:
print('[*] Detected Non A12(X) Device')
print('[*] Device ApNonce matches the default unc0ver or chimera generator')
break;

else:
print('[*] Detected Non A12(X) Device')
print('[*] Device ApNonce does not match the unc0ver or chimera generator')
break;

print('[D] Device Model = ' + deviceid)
print('[D] Device UDID = ' + udid)
print('[D] BoardConfig = ' + boardid)
print('[D] ECID = ' + ecid)
print('[D] ApNonce = ' + apnonce)

iosversion = input('[D] Enter the iOS version to save the ticket for > ')

if (os.path.isdir(savePath + '/' + ecid) is False):
try:
os.mkdir(savePath + '/' + ecid)
except FileExistsError:
print('[*] Skipping creating ECID folder as %s it already exists' %ecid)

savePath = savePath + '/' + ecid

if (os.path.isdir(savePath + '/' + iosversion) is False):
try:
os.mkdir(savePath + '/' + iosversion)
except FileExistsError:
print('[*] Skipping creating iOS version folder as %s it already exists' %ecid)

savePath = savePath + '/' + iosversion

popen = subprocess.Popen('tsschecker.exe -d %s' %deviceid + ' -e %s' %ecid + ' --boardconfig %s' %boardid + ' --ios %s' %iosversion + ' --apnonce %s' %apnonce + ' -s --save-path %s' %savePath, shell = True, stdout=subprocess.PIPE,stderr=subprocess.PIPE, encoding='utf8')

print('[*] Checking ticket against device in Recovery Mode')
input('[*] Press Enter When File is Saved > ')

ticket = ''
for file in glob.glob(os.path.join(savePath, "*.shsh2")):
ticket = file

print('[*] Checking this ticket ' + ticket)

popen = subprocess.Popen('futurerestore.exe -w -t %s ' %ticket, shell = True, stdout=subprocess.PIPE,stderr=subprocess.PIPE, encoding='utf8')
communicateRes = popen.communicate()
ticketCheck, stdErrValue = communicateRes
print('\n\n[*] %s' %ticketCheck)
print('[*] Exiting Recovery Mode')

popen = subprocess.Popen('futurerestore.exe --exit', shell = True, stdout=subprocess.PIPE,stderr=subprocess.PIPE, encoding='utf8')
if (ticket != None) is True:
print('[*] File Save as ' + ticket)
else:
print('Problem occurred when saving SHSH ticket')
print('[*] Exiting')
Binary file added windows/dist/SaveMe.exe
Binary file not shown.

0 comments on commit fd2d514

Please sign in to comment.