@@ -605,8 +605,25 @@ class ArchiveProgramDataFromTitleId : public Archive {
605605 throw Mikage::Exceptions::Invalid (" Invalid sub file type {}" , sub_file_type);
606606 }
607607
608- auto sub_file = OpenNCCHSubFile (thread, program_info, content_id, sub_file_type, std::basic_string_view<uint8_t > { path.data () + 0xc , 8 }, gamecard);
609- return std::make_pair (RESULT_OK, std::move (sub_file));
608+ try {
609+ auto sub_file = OpenNCCHSubFile (thread, program_info, content_id, sub_file_type, std::basic_string_view<uint8_t > { path.data () + 0xc , 8 }, gamecard);
610+ return std::make_pair (RESULT_OK, std::move (sub_file));
611+ } catch (const std::runtime_error& err) {
612+ if (std::string_view { err.what () }.starts_with (" Tried to access non-existing title" )) {
613+ // Report "not found" for some specific titles that may be
614+ // probed by system titles but which won't be present after
615+ // NAND bootstrap from gamecard update partitions.
616+ // 0x4001000022400: Camera app, probed during initial system setup
617+ // 0x4003000009d02: Internet Browser, probed by HOME Menu on system version 9.2.0
618+ // 0x400300000ba02: In-app Miiverse posting applet, probed by HOME Menu on system versions >= 10.5.0
619+ if (program_info.program_id == 0x4001000022400 ||
620+ program_info.program_id == 0x4003000009d02 ||
621+ program_info.program_id == 0x400300000ba02 ) {
622+ return std::make_pair (0xc8804478 , std::unique_ptr<File> { });
623+ }
624+ }
625+ throw ;
626+ }
610627 }
611628
612629public:
@@ -676,8 +693,7 @@ static std::tuple<Result, uint64_t> OpenFile(FakeThread& thread, Context& contex
676693 std::unique_ptr<File> file;
677694 std::tie (result,file) = archive->OpenFile (thread, common_path);
678695 if (result != RESULT_OK) {
679- thread.GetLogger ()->error (" Failed to get file open handler" );
680- thread.CallSVC (&OSImpl::SVCBreak, OSImpl::BreakReason::Panic);
696+ return std::make_tuple (result, 0 );
681697 }
682698
683699 // TODO: Respect flags & ~0x4 ... in particular, write/read-only!
0 commit comments