3
0
Fork 0
forked from suyu/suyu

loader: Add recognition for KIP file type

This commit is contained in:
Zach Hilman 2019-06-05 00:22:07 -04:00
parent a76bd49268
commit ce9f7ac4f2
2 changed files with 11 additions and 0 deletions

View file

@ -11,6 +11,7 @@
#include "core/hle/kernel/process.h"
#include "core/loader/deconstructed_rom_directory.h"
#include "core/loader/elf.h"
#include "core/loader/kip.h"
#include "core/loader/nax.h"
#include "core/loader/nca.h"
#include "core/loader/nro.h"
@ -36,6 +37,7 @@ FileType IdentifyFile(FileSys::VirtualFile file) {
CHECK_TYPE(XCI)
CHECK_TYPE(NAX)
CHECK_TYPE(NSP)
CHECK_TYPE(KIP)
#undef CHECK_TYPE
@ -63,6 +65,8 @@ FileType GuessFromFilename(const std::string& name) {
return FileType::XCI;
if (extension == "nsp")
return FileType::NSP;
if (extension == "kip")
return FileType::KIP;
return FileType::Unknown;
}
@ -83,6 +87,8 @@ std::string GetFileTypeString(FileType type) {
return "NAX";
case FileType::NSP:
return "NSP";
case FileType::KIP:
return "KIP";
case FileType::DeconstructedRomDirectory:
return "Directory";
case FileType::Error:
@ -209,6 +215,10 @@ static std::unique_ptr<AppLoader> GetFileLoader(FileSys::VirtualFile file, FileT
case FileType::NSP:
return std::make_unique<AppLoader_NSP>(std::move(file));
// NX KIP (Kernel Internal Process) file format
case FileType::KIP:
return std::make_unique<AppLoader_KIP>(std::move(file));
// NX deconstructed ROM directory.
case FileType::DeconstructedRomDirectory:
return std::make_unique<AppLoader_DeconstructedRomDirectory>(std::move(file));

View file

@ -37,6 +37,7 @@ enum class FileType {
NSP,
XCI,
NAX,
KIP,
DeconstructedRomDirectory,
};