mirror of
https://github.com/encounter/Decrypt9.git
synced 2026-03-30 11:06:30 -07:00
24 lines
626 B
Python
24 lines
626 B
Python
#!/usr/bin/env python2
|
|
import struct
|
|
import os
|
|
import sys
|
|
from binascii import hexlify
|
|
|
|
if len(sys.argv) < 2:
|
|
print "Usage: print_ticket_keys.py decTitleKeys.bin"
|
|
sys.exit(0)
|
|
|
|
if not os.path.isfile(sys.argv[1]):
|
|
print "Input file '%s' doesn't exist." % sys.argv[1]
|
|
raise SystemExit(0)
|
|
|
|
with open(sys.argv[1], 'rb') as fh:
|
|
nEntries = struct.unpack('<I', fh.read(4))[0]
|
|
fh.seek(12, os.SEEK_CUR)
|
|
|
|
for i in xrange(nEntries):
|
|
fh.seek(8, os.SEEK_CUR)
|
|
titleId = fh.read(8)
|
|
decryptedTitleKey = fh.read(16)
|
|
print '%s: %s' % (hexlify(titleId), hexlify(decryptedTitleKey))
|