Skip to content

Commit

Permalink
Print more details when installing alloc8 exploit
Browse files Browse the repository at this point in the history
  • Loading branch information
axi0mX committed Jun 9, 2017
1 parent 735c2ce commit 75b0f23
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
3 changes: 1 addition & 2 deletions dfuexec.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ def add_24Kpwn_exploit_to_nor(self, nor):
assert len(nor) == len(new_nor)
return new_nor

def add_alloc8_exploit_to_nor(self, nor):
def add_alloc8_exploit_to_nor(self, nor, securerom):
SHELLCODE_ADDRESS = 0x84026214 + 1
MAX_SHELLCODE_LENGTH = 460
REQUIRED_IMG3_COUNT = 714
Expand Down Expand Up @@ -377,7 +377,6 @@ def add_alloc8_exploit_to_nor(self, nor):
new_nor_firmware += empty_img3_data(final_size)

# Only override data abort handler, keep the rest
securerom = self.securerom_dump()
securerom_block = securerom[8:8+NOR_READ_SIZE]
new_nor_firmware += securerom_block[:40] + struct.pack('<I', SHELLCODE_ADDRESS) + securerom_block[44:]
new_nor_firmware += '\xff' * (len(nor_firmware) - len(new_nor_firmware))
Expand Down
10 changes: 9 additions & 1 deletion ipwndfu
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,17 @@ if __name__ == '__main__':
if device.config.version == '359.3':
print 'WARNING: iPhone 3GS (old bootrom) was detected. Use 24Kpwn exploit for faster boots. alloc8 exploit is supported for testing purposes only.'
raw_input("Press ENTER to continue.")

print 'Installing alloc8 exploit to NOR.'

print 'Dumping SecureROM.'
securerom = device.securerom_dump()

nor = device.nor_dump(saveBackup=True)
new_nor = device.add_alloc8_exploit_to_nor(nor)

print 'Preparing modified NOR with alloc8 exploit.'
new_nor = device.add_alloc8_exploit_to_nor(nor, securerom)

device.flash_nor(new_nor)

if opt == '--send':
Expand Down

0 comments on commit 75b0f23

Please sign in to comment.