summaryrefslogtreecommitdiff
path: root/src/core/loader/xci.cpp
diff options
context:
space:
mode:
authorGravatar Zach Hilman2018-08-25 11:48:23 -0400
committerGravatar Zach Hilman2018-09-04 14:27:33 -0400
commit5c8aff984e47c0f471e9eafd071031bc49ad8efc (patch)
treeac5ecdfc187f04a677b61f62eea6d6614326e636 /src/core/loader/xci.cpp
parentfile_sys: Add Nintendo Submission Package (NSP) (diff)
downloadyuzu-5c8aff984e47c0f471e9eafd071031bc49ad8efc.tar.gz
yuzu-5c8aff984e47c0f471e9eafd071031bc49ad8efc.tar.xz
yuzu-5c8aff984e47c0f471e9eafd071031bc49ad8efc.zip
card_image: Parse XCI secure partition with NSP
Eliminated duplicate code and adds support for Rev1+ carts
Diffstat (limited to 'src/core/loader/xci.cpp')
-rw-r--r--src/core/loader/xci.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/core/loader/xci.cpp b/src/core/loader/xci.cpp
index 9dc4d1f35..75b998faa 100644
--- a/src/core/loader/xci.cpp
+++ b/src/core/loader/xci.cpp
@@ -17,8 +17,7 @@ namespace Loader {
17 17
18AppLoader_XCI::AppLoader_XCI(FileSys::VirtualFile file) 18AppLoader_XCI::AppLoader_XCI(FileSys::VirtualFile file)
19 : AppLoader(file), xci(std::make_unique<FileSys::XCI>(file)), 19 : AppLoader(file), xci(std::make_unique<FileSys::XCI>(file)),
20 nca_loader(std::make_unique<AppLoader_NCA>( 20 nca_loader(std::make_unique<AppLoader_NCA>(xci->GetProgramNCAFile())) {
21 xci->GetNCAFileByType(FileSys::NCAContentType::Program))) {
22 if (xci->GetStatus() != ResultStatus::Success) 21 if (xci->GetStatus() != ResultStatus::Success)
23 return; 22 return;
24 const auto control_nca = xci->GetNCAByType(FileSys::NCAContentType::Control); 23 const auto control_nca = xci->GetNCAByType(FileSys::NCAContentType::Control);
@@ -64,11 +63,11 @@ ResultStatus AppLoader_XCI::Load(Kernel::SharedPtr<Kernel::Process>& process) {
64 if (xci->GetProgramNCAStatus() != ResultStatus::Success) 63 if (xci->GetProgramNCAStatus() != ResultStatus::Success)
65 return xci->GetProgramNCAStatus(); 64 return xci->GetProgramNCAStatus();
66 65
67 const auto nca = xci->GetNCAFileByType(FileSys::NCAContentType::Program); 66 const auto nca = xci->GetProgramNCA();
68 if (nca == nullptr && !Core::Crypto::KeyManager::KeyFileExists(false)) 67 if (nca == nullptr && !Core::Crypto::KeyManager::KeyFileExists(false))
69 return ResultStatus::ErrorMissingProductionKeyFile; 68 return ResultStatus::ErrorMissingProductionKeyFile;
70 69
71 auto result = nca_loader->Load(process); 70 const auto result = nca_loader->Load(process);
72 if (result != ResultStatus::Success) 71 if (result != ResultStatus::Success)
73 return result; 72 return result;
74 73