diff --git a/SHAtter.py b/SHAtter.py index 4febed64..5dfda9c9 100755 --- a/SHAtter.py +++ b/SHAtter.py @@ -1,6 +1,9 @@ # Credit: This file is based on SHAtter exploit (segment overflow) by posixninja and pod2g. -import struct, sys, time +import struct +import sys +import time + import dfu def generate_payload(): @@ -24,13 +27,11 @@ def exploit(): return if 'CPID:8930' not in device.serial_number: - print 'ERROR: Not a compatible device. This exploit is for S5L8930 devices only. Exiting.' - sys.exit(1) + sys.exit('ERROR: Not a compatible device. This exploit is for S5L8930 devices only. Exiting.') if 'SRTG:[iBoot-574.4]' not in device.serial_number: - print 'ERROR: CPID is compatible, but serial number string does not match.' - print 'Make sure device is in SecureROM DFU Mode and not LLB/iBSS DFU Mode. Exiting.' - sys.exit(1) + sys.exit('ERROR: CPID is compatible, but serial number string does not match.\n' + 'Make sure device is in SecureROM DFU Mode and not LLB/iBSS DFU Mode. Exiting.') dfu.reset_counters(device) dfu.get_data(device, 0x40) @@ -69,7 +70,6 @@ def exploit(): dfu.release_device(device) if failed: - print 'ERROR: Exploit failed. Device did not enter pwned DFU Mode.' - sys.exit(1) + sys.exit('ERROR: Exploit failed. Device did not enter pwned DFU Mode.') print 'Device is now in pwned DFU Mode.'