freemyipod r279 - Code Review

Jump to: navigation, search
Repository:freemyipod
Revision:r278‎ | r279 | r280 >
Date:20:18, 23 November 2010
Author:theseven
Status:new
Tags:
Comment:
ipodcrypt: Fix s5l8702cryptnor (wrong key index being used)
Modified paths:
  • /embios/trunk/tools/libipodcrypto.py (modified) (history)

Diff [purge]

Index: embios/trunk/tools/libipodcrypto.py
@@ -73,14 +73,14 @@
7474
7575 def s5l8702cryptnor(data):
7676 data = data.ljust((len(data) + 0xf) & ~0xf, "\0")
77 - header = "87021.0\0\0\0\0\0" + struct.pack("<I", len(data)) + hashlib.sha1(data).digest()[:0x10]
 77+ header = "87021.0\x01\0\0\0\0" + struct.pack("<I", len(data)) + hashlib.sha1(data).digest()[:0x10]
7878 embios = libembios.Embios()
7979 embios.write(0x08000000, header.ljust(0x800, "\0") + data)
8080 embios.lib.dev.timeout = 20000
81 - embios.aesencrypt(0x08000800, len(data), 1)
82 - embios.aesencrypt(0x08000010, 0x10, 1)
 81+ embios.aesencrypt(0x08000800, len(data), 2)
 82+ embios.aesencrypt(0x08000010, 0x10, 2)
8383 embios.write(0x08000040, hashlib.sha1(embios.read(0x08000000, 0x40)).digest()[:0x10])
84 - embios.aesencrypt(0x08000040, 0x10, 1)
 84+ embios.aesencrypt(0x08000040, 0x10, 2)
8585 return embios.read(0x08000000, len(data) + 0x800)
8686
8787