Subversion Repositories freemyipod

Rev

Rev 793 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 793 Rev 794
Line 118... Line 118...
118
    emcore.free(addr)
118
    emcore.free(addr)
119
    return data
119
    return data
120
 
120
 
121
 
121
 
122
def s5l8702genpwnage800(data):
122
def s5l8702genpwnage800(data):
123
    cert = open(os.path.dirname(__file__) + "/libipodcrypto/s5l8702pwnage.cer", "rb").read()
123
    cert = open(os.path.dirname(__file__) + "/libipodcrypto/s5l8702pwnage800.cer", "rb").read()
124
    data = data.ljust(max(0x90, (len(data) + 0xf) & ~0xf), b"\0")
124
    data = data.ljust(max(0x90, (len(data) + 0xf) & ~0xf), b"\0")
125
    header = (b"87021.0\x03\0\0\0\0" + struct.pack("<IIII", len(data) - 0x80, len(data) + 0x2ba, len(data), 0x2ba)).ljust(0x40, b"\0")
125
    header = (b"87021.0\x03\0\0\0\0" + struct.pack("<IIII", len(data) - 0x80, len(data) + 0x2ba, len(data), 0x2ba)).ljust(0x40, b"\0")
126
    emcore = libemcore.Emcore()
126
    emcore = libemcore.Emcore()
127
    addr = emcore.memalign(0x10, len(data))
127
    addr = emcore.memalign(0x10, len(data))
128
    emcore.write(addr, header + hashlib.sha1(header).digest()[:0x10])
128
    emcore.write(addr, header + hashlib.sha1(header).digest()[:0x10])