From 63f26d5c40adb49094b03b232528672f526afe49 Mon Sep 17 00:00:00 2001 From: Zach Hilman Date: Thu, 21 Jun 2018 11:16:23 -0400 Subject: Add support for decrypted NCA files (#567) * Start to add NCA support in loader * More nca stuff * More changes to nca.cpp * Now identifies decrypted NCA cont. * Game list fixes and more structs and stuff * More updates to Nca class * Now reads ExeFs (i think) * ACTUALLY LOADS EXEFS! * RomFS loads and games execute * Cleanup and Finalize * plumbing, cleanup and testing * fix some things that i didnt think of before * Preliminary Review Changes * Review changes for bunnei and subv --- src/core/loader/loader.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/core/loader/loader.cpp') diff --git a/src/core/loader/loader.cpp b/src/core/loader/loader.cpp index 6a4fd38cb..20cc0bac0 100644 --- a/src/core/loader/loader.cpp +++ b/src/core/loader/loader.cpp @@ -9,6 +9,7 @@ #include "core/hle/kernel/process.h" #include "core/loader/deconstructed_rom_directory.h" #include "core/loader/elf.h" +#include "core/loader/nca.h" #include "core/loader/nro.h" #include "core/loader/nso.h" @@ -32,6 +33,7 @@ FileType IdentifyFile(FileUtil::IOFile& file, const std::string& filepath) { CHECK_TYPE(ELF) CHECK_TYPE(NSO) CHECK_TYPE(NRO) + CHECK_TYPE(NCA) #undef CHECK_TYPE @@ -57,6 +59,8 @@ FileType GuessFromExtension(const std::string& extension_) { return FileType::NRO; else if (extension == ".nso") return FileType::NSO; + else if (extension == ".nca") + return FileType::NCA; return FileType::Unknown; } @@ -69,6 +73,8 @@ const char* GetFileTypeString(FileType type) { return "NRO"; case FileType::NSO: return "NSO"; + case FileType::NCA: + return "NCA"; case FileType::DeconstructedRomDirectory: return "Directory"; case FileType::Error: @@ -104,6 +110,10 @@ static std::unique_ptr GetFileLoader(FileUtil::IOFile&& file, FileTyp case FileType::NRO: return std::make_unique(std::move(file), filepath); + // NX NCA file format. + case FileType::NCA: + return std::make_unique(std::move(file), filepath); + // NX deconstructed ROM directory. case FileType::DeconstructedRomDirectory: return std::make_unique(std::move(file), filepath); -- cgit v1.2.3