diff options
| -rw-r--r-- | src/core/file_sys/card_image.cpp | 10 | ||||
| -rw-r--r-- | src/core/file_sys/card_image.h | 2 | ||||
| -rw-r--r-- | src/core/loader/xci.cpp | 3 |
3 files changed, 8 insertions, 7 deletions
diff --git a/src/core/file_sys/card_image.cpp b/src/core/file_sys/card_image.cpp index 8f5142a07..ecdd7505b 100644 --- a/src/core/file_sys/card_image.cpp +++ b/src/core/file_sys/card_image.cpp | |||
| @@ -122,14 +122,16 @@ u64 XCI::GetProgramTitleID() const { | |||
| 122 | return secure_partition->GetProgramTitleID(); | 122 | return secure_partition->GetProgramTitleID(); |
| 123 | } | 123 | } |
| 124 | 124 | ||
| 125 | std::shared_ptr<NCA> XCI::GetProgramNCA() const { | 125 | bool XCI::HasProgramNCA() const { |
| 126 | return program; | 126 | return program != nullptr; |
| 127 | } | 127 | } |
| 128 | 128 | ||
| 129 | VirtualFile XCI::GetProgramNCAFile() const { | 129 | VirtualFile XCI::GetProgramNCAFile() const { |
| 130 | if (GetProgramNCA() == nullptr) | 130 | if (!HasProgramNCA()) { |
| 131 | return nullptr; | 131 | return nullptr; |
| 132 | return GetProgramNCA()->GetBaseFile(); | 132 | } |
| 133 | |||
| 134 | return program->GetBaseFile(); | ||
| 133 | } | 135 | } |
| 134 | 136 | ||
| 135 | const std::vector<std::shared_ptr<NCA>>& XCI::GetNCAs() const { | 137 | const std::vector<std::shared_ptr<NCA>>& XCI::GetNCAs() const { |
diff --git a/src/core/file_sys/card_image.h b/src/core/file_sys/card_image.h index ce514dfa0..48cbef666 100644 --- a/src/core/file_sys/card_image.h +++ b/src/core/file_sys/card_image.h | |||
| @@ -80,7 +80,7 @@ public: | |||
| 80 | 80 | ||
| 81 | u64 GetProgramTitleID() const; | 81 | u64 GetProgramTitleID() const; |
| 82 | 82 | ||
| 83 | std::shared_ptr<NCA> GetProgramNCA() const; | 83 | bool HasProgramNCA() const; |
| 84 | VirtualFile GetProgramNCAFile() const; | 84 | VirtualFile GetProgramNCAFile() const; |
| 85 | const std::vector<std::shared_ptr<NCA>>& GetNCAs() const; | 85 | const std::vector<std::shared_ptr<NCA>>& GetNCAs() const; |
| 86 | std::shared_ptr<NCA> GetNCAByType(NCAContentType type) const; | 86 | std::shared_ptr<NCA> GetNCAByType(NCAContentType type) const; |
diff --git a/src/core/loader/xci.cpp b/src/core/loader/xci.cpp index 7a619acb4..461607c95 100644 --- a/src/core/loader/xci.cpp +++ b/src/core/loader/xci.cpp | |||
| @@ -59,8 +59,7 @@ ResultStatus AppLoader_XCI::Load(Kernel::Process& process) { | |||
| 59 | if (xci->GetProgramNCAStatus() != ResultStatus::Success) | 59 | if (xci->GetProgramNCAStatus() != ResultStatus::Success) |
| 60 | return xci->GetProgramNCAStatus(); | 60 | return xci->GetProgramNCAStatus(); |
| 61 | 61 | ||
| 62 | const auto nca = xci->GetProgramNCA(); | 62 | if (!xci->HasProgramNCA() && !Core::Crypto::KeyManager::KeyFileExists(false)) |
| 63 | if (nca == nullptr && !Core::Crypto::KeyManager::KeyFileExists(false)) | ||
| 64 | return ResultStatus::ErrorMissingProductionKeyFile; | 63 | return ResultStatus::ErrorMissingProductionKeyFile; |
| 65 | 64 | ||
| 66 | const auto result = nca_loader->Load(process); | 65 | const auto result = nca_loader->Load(process); |