def __str__(self): string = ' ACID:\n' string += ' ACID flags: %d\n' % self.flags string += ' TitleID range: %016x-%016x\n' % (self.tid_min, self.tid_max) string += memdump(self.rsa_sig, message=' RSA signature: ') + '\n' string += memdump(self.rsa_pubk, message=' RSA public key: ') + '\n' string += '\n' + str(self.fs_access_control) string += '\n' + str(self.service_access_control) string += '\n' + str(self.kernel_access_control) return string
def print_more(self): print('%s:' % os.path.basename(self.name)) print(' Content type: %s' % self.header.content_type) print(' Size: %s' % bytes2human(self.header.size)) print(' Distribution Type: %s' % ('Gamecard' if self.header.is_game_card else 'Digital')) print(' Title ID: %016x' % self.header.tid) if self.has_rights_id: print(' Rights ID: %032x' % self.rights_id) print(' Master key revision: %d' % self.crypto_type) print(' Encryption type: %s' % ('Titlekey' if self.has_rights_id else 'Standard')) if self.has_rights_id and not self.has_tkey: print('Titlekey not available') return print(' Body key: %s' % hx(self.body_key).decode()) print( memdump(self.header.rsa_sig_1, message=' Fixed key signature: ', length=32)) print( memdump(self.header.rsa_sig_2, message=' NPDM signature: ', length=32)) print() for n, sec in enumerate(self.sections): print('Section %d (%s):' % (n, bytes2human(sec.size))) print(' Type: %s' % ('ExeFS' if sec.is_exefs else sec.fs_type)) print(' Counter: %032x' % ((int.from_bytes(sec.nonce, byteorder='big') << 64) + (sec.section_offset >> 4))) print(' Offset: 0x%x' % sec.offset_in_cont) if sec.section_header.fs_type == 'RomFS': print(' Block Size: 0x%x' % sec.section_header.superblock.lvls[0].block_size) print(' Directories: %d' % sec.fs.dir_nb) else: print(' Block Size: 0x%x' % sec.section_header.superblock.block_size) print(' Files: %d' % sec.fs.file_nb) print(str(sec.fs)) print()