Release 0.0.8
Fixed: - Issue #7: fix manually supplied .ird files not being used.
This commit is contained in:
parent
52bf2bad01
commit
88d1b48167
6 changed files with 36 additions and 7 deletions
|
|
@ -51,10 +51,10 @@ class IRD:
|
|||
MAGIC_STRING = b'3IRD'
|
||||
|
||||
|
||||
def __init__(self, args):
|
||||
def __init__(self, ird_path, verbose=False):
|
||||
"""IRD constructor using args from argparse."""
|
||||
|
||||
self.uncompress(args.ird) # TODO: Try/Except?
|
||||
self.uncompress(ird_path) # TODO: Try/Except?
|
||||
|
||||
self.size = core.size(self.TEMP_FILE)
|
||||
|
||||
|
|
@ -107,7 +107,7 @@ class IRD:
|
|||
if self.version < 7:
|
||||
self.uid = core.to_int(input_ird.read(4), self.ORDER)
|
||||
|
||||
if args.verbose:
|
||||
if verbose:
|
||||
self.print_info()
|
||||
|
||||
os.remove(self.TEMP_FILE)
|
||||
|
|
|
|||
|
|
@ -174,8 +174,6 @@ class ISO:
|
|||
db = sqlite3.connect((pathlib.Path(__file__).resolve() / 'data/') / 'keys.db')
|
||||
c = db.cursor()
|
||||
|
||||
|
||||
|
||||
#core.vprint('Calculating crc32', args)
|
||||
|
||||
#input_iso.seek(0)
|
||||
|
|
@ -228,7 +226,7 @@ class ISO:
|
|||
core.warning('No IRD file specified, finding required file', args)
|
||||
args.ird = core.ird_by_game_id(self.game_id) # Download ird
|
||||
|
||||
self.ird = ird.IRD(args)
|
||||
self.ird = ird.IRD(args.ird)
|
||||
|
||||
if self.ird.region_count != len(self.regions)-1:
|
||||
core.error('Corrupt ISO or error in IRD. Expected %s regions, found %s regions' % (self.ird.region_count, len(self.regions)-1))
|
||||
|
|
@ -237,6 +235,21 @@ class ISO:
|
|||
core.error('Corrupt ISO or error in IRD. Expected filesize larger than %.2f GiB, actual size is %.2f GiB' % (self.regions[-1]['start'] / 1024**3, self.size / 1024**3 ) )
|
||||
|
||||
self.disc_key = cipher.encrypt(self.ird.data1)
|
||||
|
||||
else:
|
||||
|
||||
# .ird file given with -k / --ird
|
||||
|
||||
self.ird = ird.IRD(args.ird)
|
||||
|
||||
if self.ird.region_count != len(self.regions)-1:
|
||||
core.error('Corrupt ISO or error in IRD. Expected %s regions, found %s regions' % (self.ird.region_count, len(self.regions)-1))
|
||||
|
||||
if self.regions[-1]['start'] > self.size:
|
||||
core.error('Corrupt ISO or error in IRD. Expected filesize larger than %.2f GiB, actual size is %.2f GiB' % (self.regions[-1]['start'] / 1024**3, self.size / 1024**3 ) )
|
||||
|
||||
self.disc_key = cipher.encrypt(self.ird.data1)
|
||||
|
||||
else:
|
||||
self.disc_key = core.to_bytes(args.decryption_key)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue