From 48f92579cecc68b1f92558e14951ea395d6ded2a Mon Sep 17 00:00:00 2001 From: Ian Burgwin Date: Tue, 28 Jul 2020 06:15:27 -0700 Subject: [PATCH] custominstall: use bytes(cia.tmd) instead of reading tmd file directly --- custominstall.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/custominstall.py b/custominstall.py index dc3cc50..6ddad5a 100644 --- a/custominstall.py +++ b/custominstall.py @@ -274,10 +274,9 @@ class CustomInstall: # write the tmd enc_path = content_root_cmd + '/' + tmd_filename self.log(f'Writing {enc_path}...') - with cia.open_raw_section(CIASection.TitleMetadata) as s: - with open(join(content_root, tmd_filename), 'wb') as o: - self.copy_with_progress(s, o, cia.sections[CIASection.TitleMetadata].size, enc_path, - fire_event=False) + with open(join(content_root, tmd_filename), 'wb') as o: + with self.crypto.create_ctr_io(Keyslot.SD, o, self.crypto.sd_path_to_iv(enc_path)) as e: + e.write(bytes(cia.tmd)) # write each content for co in cia.content_info: