summaryrefslogtreecommitdiffstats
path: root/src/core/loader
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-12-27 17:15:34 +0100
committerGitHub <noreply@github.com>2018-12-27 17:15:34 +0100
commit795335af0f37ce25da3c3ca8eeab62c50f87d366 (patch)
tree48bde2f34a4e9c87dc96f83bfbeeeee96b72b9e6 /src/core/loader
parentMerge pull request #1892 from Tinob/master (diff)
parentkernel/process: Hook up the process capability parser to the process itself (diff)
downloadyuzu-795335af0f37ce25da3c3ca8eeab62c50f87d366.tar
yuzu-795335af0f37ce25da3c3ca8eeab62c50f87d366.tar.gz
yuzu-795335af0f37ce25da3c3ca8eeab62c50f87d366.tar.bz2
yuzu-795335af0f37ce25da3c3ca8eeab62c50f87d366.tar.lz
yuzu-795335af0f37ce25da3c3ca8eeab62c50f87d366.tar.xz
yuzu-795335af0f37ce25da3c3ca8eeab62c50f87d366.tar.zst
yuzu-795335af0f37ce25da3c3ca8eeab62c50f87d366.zip
Diffstat (limited to 'src/core/loader')
-rw-r--r--src/core/loader/deconstructed_rom_directory.cpp5
-rw-r--r--src/core/loader/loader.cpp4
-rw-r--r--src/core/loader/loader.h2
3 files changed, 9 insertions, 2 deletions
diff --git a/src/core/loader/deconstructed_rom_directory.cpp b/src/core/loader/deconstructed_rom_directory.cpp
index ac04d72d7..07aa7a1cd 100644
--- a/src/core/loader/deconstructed_rom_directory.cpp
+++ b/src/core/loader/deconstructed_rom_directory.cpp
@@ -129,7 +129,10 @@ ResultStatus AppLoader_DeconstructedRomDirectory::Load(Kernel::Process& process)
return ResultStatus::Error32BitISA;
}
- process.LoadFromMetadata(metadata);
+ if (process.LoadFromMetadata(metadata).IsError()) {
+ return ResultStatus::ErrorUnableToParseKernelMetadata;
+ }
+
const FileSys::PatchManager pm(metadata.GetTitleID());
// Load NSO modules
diff --git a/src/core/loader/loader.cpp b/src/core/loader/loader.cpp
index 9cd0b0ccd..d8cc30959 100644
--- a/src/core/loader/loader.cpp
+++ b/src/core/loader/loader.cpp
@@ -93,7 +93,7 @@ std::string GetFileTypeString(FileType type) {
return "unknown";
}
-constexpr std::array<const char*, 60> RESULT_MESSAGES{
+constexpr std::array<const char*, 62> RESULT_MESSAGES{
"The operation completed successfully.",
"The loader requested to load is already loaded.",
"The operation is not implemented.",
@@ -103,6 +103,7 @@ constexpr std::array<const char*, 60> RESULT_MESSAGES{
"The NPDM has a bad ACI header,",
"The NPDM file has a bad file access control.",
"The NPDM has a bad file access header.",
+ "The NPDM has bad kernel capability descriptors.",
"The PFS/HFS partition has a bad header.",
"The PFS/HFS partition has incorrect size as determined by the header.",
"The NCA file has a bad header.",
@@ -125,6 +126,7 @@ constexpr std::array<const char*, 60> RESULT_MESSAGES{
"The file could not be found or does not exist.",
"The game is missing a program metadata file (main.npdm).",
"The game uses the currently-unimplemented 32-bit architecture.",
+ "Unable to completely parse the kernel metadata when loading the emulated process",
"The RomFS could not be found.",
"The ELF file has incorrect size as determined by the header.",
"There was a general error loading the NRO into emulated memory.",
diff --git a/src/core/loader/loader.h b/src/core/loader/loader.h
index cfd67adc0..30eacd803 100644
--- a/src/core/loader/loader.h
+++ b/src/core/loader/loader.h
@@ -71,6 +71,7 @@ enum class ResultStatus : u16 {
ErrorBadACIHeader,
ErrorBadFileAccessControl,
ErrorBadFileAccessHeader,
+ ErrorBadKernelCapabilityDescriptors,
ErrorBadPFSHeader,
ErrorIncorrectPFSFileSize,
ErrorBadNCAHeader,
@@ -93,6 +94,7 @@ enum class ResultStatus : u16 {
ErrorNullFile,
ErrorMissingNPDM,
Error32BitISA,
+ ErrorUnableToParseKernelMetadata,
ErrorNoRomFS,
ErrorIncorrectELFFileSize,
ErrorLoadingNRO,