update to pyctr 0.4.1, catch exceptions when creating CIAReader

This commit is contained in:
Ian Burgwin
2020-07-12 21:07:26 -07:00
parent 2319819bfa
commit 13f706a0dc
2 changed files with 10 additions and 3 deletions

View File

@@ -20,7 +20,7 @@ if TYPE_CHECKING:
from events import Events
from pyctr.crypto import CryptoEngine, Keyslot
from pyctr.crypto import CryptoEngine, Keyslot, load_seeddb
from pyctr.type.cia import CIAReader, CIASection
from pyctr.type.ncch import NCCHSection
from pyctr.util import roundup
@@ -173,12 +173,19 @@ class CustomInstall:
title_info_entries = {}
cifinish_data = load_cifinish(cifinish_path)
load_seeddb(self.seeddb)
# Now loop through all provided cia files
for c in self.cias:
self.log('Reading ' + c)
cia = CIAReader(c, seeddb=self.seeddb)
try:
cia = CIAReader(c)
except Exception as e:
self.log(f'Failed to load file: {type(e).__name__}: {e}')
continue
self.cia = cia
tid_parts = (cia.tmd.title_id[0:8], cia.tmd.title_id[8:16])