diff options
Diffstat (limited to 'src/core/loader/ncch.h')
| -rw-r--r-- | src/core/loader/ncch.h | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/src/core/loader/ncch.h b/src/core/loader/ncch.h index fd9258970..9ae2de99f 100644 --- a/src/core/loader/ncch.h +++ b/src/core/loader/ncch.h | |||
| @@ -5,7 +5,6 @@ | |||
| 5 | #pragma once | 5 | #pragma once |
| 6 | 6 | ||
| 7 | #include "common/common.h" | 7 | #include "common/common.h" |
| 8 | #include "common/file_util.h" | ||
| 9 | 8 | ||
| 10 | #include "core/loader/loader.h" | 9 | #include "core/loader/loader.h" |
| 11 | 10 | ||
| @@ -14,7 +13,7 @@ | |||
| 14 | 13 | ||
| 15 | struct NCCH_Header { | 14 | struct NCCH_Header { |
| 16 | u8 signature[0x100]; | 15 | u8 signature[0x100]; |
| 17 | char magic[4]; | 16 | u32 magic; |
| 18 | u32 content_size; | 17 | u32 content_size; |
| 19 | u8 partition_id[8]; | 18 | u8 partition_id[8]; |
| 20 | u16 maker_code; | 19 | u16 maker_code; |
| @@ -147,8 +146,14 @@ namespace Loader { | |||
| 147 | /// Loads an NCCH file (e.g. from a CCI, or the first NCCH in a CXI) | 146 | /// Loads an NCCH file (e.g. from a CCI, or the first NCCH in a CXI) |
| 148 | class AppLoader_NCCH final : public AppLoader { | 147 | class AppLoader_NCCH final : public AppLoader { |
| 149 | public: | 148 | public: |
| 150 | AppLoader_NCCH(const std::string& filename); | 149 | AppLoader_NCCH(std::unique_ptr<FileUtil::IOFile>&& file) : AppLoader(std::move(file)) { } |
| 151 | ~AppLoader_NCCH() override; | 150 | |
| 151 | /** | ||
| 152 | * Returns the type of the file | ||
| 153 | * @param file FileUtil::IOFile open file | ||
| 154 | * @return FileType found, or FileType::Error if this loader doesn't know it | ||
| 155 | */ | ||
| 156 | static FileType IdentifyType(FileUtil::IOFile& file); | ||
| 152 | 157 | ||
| 153 | /** | 158 | /** |
| 154 | * Load the application | 159 | * Load the application |
| @@ -213,14 +218,11 @@ private: | |||
| 213 | */ | 218 | */ |
| 214 | ResultStatus LoadExec() const; | 219 | ResultStatus LoadExec() const; |
| 215 | 220 | ||
| 216 | std::string filename; | 221 | bool is_compressed = false; |
| 217 | |||
| 218 | bool is_loaded; | ||
| 219 | bool is_compressed; | ||
| 220 | 222 | ||
| 221 | u32 entry_point; | 223 | u32 entry_point = 0; |
| 222 | u32 ncch_offset; // Offset to NCCH header, can be 0 or after NCSD header | 224 | u32 ncch_offset = 0; // Offset to NCCH header, can be 0 or after NCSD header |
| 223 | u32 exefs_offset; | 225 | u32 exefs_offset = 0; |
| 224 | 226 | ||
| 225 | NCCH_Header ncch_header; | 227 | NCCH_Header ncch_header; |
| 226 | ExeFs_Header exefs_header; | 228 | ExeFs_Header exefs_header; |