custominstall: use bytes(cia.tmd) instead of reading tmd file directly

This commit is contained in:
Ian Burgwin
2020-07-28 06:15:27 -07:00
parent 06f70e37dc
commit 48f92579ce

View File

@@ -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 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: