diff options
Diffstat (limited to 'src/core/loader/ncch.h')
| -rw-r--r-- | src/core/loader/ncch.h | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/core/loader/ncch.h b/src/core/loader/ncch.h index 29e39d2c0..b4374a476 100644 --- a/src/core/loader/ncch.h +++ b/src/core/loader/ncch.h | |||
| @@ -163,7 +163,8 @@ namespace Loader { | |||
| 163 | /// Loads an NCCH file (e.g. from a CCI, or the first NCCH in a CXI) | 163 | /// Loads an NCCH file (e.g. from a CCI, or the first NCCH in a CXI) |
| 164 | class AppLoader_NCCH final : public AppLoader { | 164 | class AppLoader_NCCH final : public AppLoader { |
| 165 | public: | 165 | public: |
| 166 | AppLoader_NCCH(std::unique_ptr<FileUtil::IOFile>&& file) : AppLoader(std::move(file)) { } | 166 | AppLoader_NCCH(FileUtil::IOFile&& file, const std::string& filepath) |
| 167 | : AppLoader(std::move(file)), filepath(filepath) { } | ||
| 167 | 168 | ||
| 168 | /** | 169 | /** |
| 169 | * Returns the type of the file | 170 | * Returns the type of the file |
| @@ -183,35 +184,35 @@ public: | |||
| 183 | * @param buffer Reference to buffer to store data | 184 | * @param buffer Reference to buffer to store data |
| 184 | * @return ResultStatus result of function | 185 | * @return ResultStatus result of function |
| 185 | */ | 186 | */ |
| 186 | ResultStatus ReadCode(std::vector<u8>& buffer) const override; | 187 | ResultStatus ReadCode(std::vector<u8>& buffer) override; |
| 187 | 188 | ||
| 188 | /** | 189 | /** |
| 189 | * Get the icon (typically icon section) of the application | 190 | * Get the icon (typically icon section) of the application |
| 190 | * @param buffer Reference to buffer to store data | 191 | * @param buffer Reference to buffer to store data |
| 191 | * @return ResultStatus result of function | 192 | * @return ResultStatus result of function |
| 192 | */ | 193 | */ |
| 193 | ResultStatus ReadIcon(std::vector<u8>& buffer) const override; | 194 | ResultStatus ReadIcon(std::vector<u8>& buffer) override; |
| 194 | 195 | ||
| 195 | /** | 196 | /** |
| 196 | * Get the banner (typically banner section) of the application | 197 | * Get the banner (typically banner section) of the application |
| 197 | * @param buffer Reference to buffer to store data | 198 | * @param buffer Reference to buffer to store data |
| 198 | * @return ResultStatus result of function | 199 | * @return ResultStatus result of function |
| 199 | */ | 200 | */ |
| 200 | ResultStatus ReadBanner(std::vector<u8>& buffer) const override; | 201 | ResultStatus ReadBanner(std::vector<u8>& buffer) override; |
| 201 | 202 | ||
| 202 | /** | 203 | /** |
| 203 | * Get the logo (typically logo section) of the application | 204 | * Get the logo (typically logo section) of the application |
| 204 | * @param buffer Reference to buffer to store data | 205 | * @param buffer Reference to buffer to store data |
| 205 | * @return ResultStatus result of function | 206 | * @return ResultStatus result of function |
| 206 | */ | 207 | */ |
| 207 | ResultStatus ReadLogo(std::vector<u8>& buffer) const override; | 208 | ResultStatus ReadLogo(std::vector<u8>& buffer) override; |
| 208 | 209 | ||
| 209 | /** | 210 | /** |
| 210 | * Get the RomFS of the application | 211 | * Get the RomFS of the application |
| 211 | * @param buffer Reference to buffer to store data | 212 | * @param buffer Reference to buffer to store data |
| 212 | * @return ResultStatus result of function | 213 | * @return ResultStatus result of function |
| 213 | */ | 214 | */ |
| 214 | ResultStatus ReadRomFS(std::vector<u8>& buffer) const override; | 215 | ResultStatus ReadRomFS(std::shared_ptr<FileUtil::IOFile>& romfs_file, u64& offset, u64& size) override; |
| 215 | 216 | ||
| 216 | private: | 217 | private: |
| 217 | 218 | ||
| @@ -221,13 +222,13 @@ private: | |||
| 221 | * @param buffer Vector to read data into | 222 | * @param buffer Vector to read data into |
| 222 | * @return ResultStatus result of function | 223 | * @return ResultStatus result of function |
| 223 | */ | 224 | */ |
| 224 | ResultStatus LoadSectionExeFS(const char* name, std::vector<u8>& buffer) const; | 225 | ResultStatus LoadSectionExeFS(const char* name, std::vector<u8>& buffer); |
| 225 | 226 | ||
| 226 | /** | 227 | /** |
| 227 | * Loads .code section into memory for booting | 228 | * Loads .code section into memory for booting |
| 228 | * @return ResultStatus result of function | 229 | * @return ResultStatus result of function |
| 229 | */ | 230 | */ |
| 230 | ResultStatus LoadExec() const; | 231 | ResultStatus LoadExec(); |
| 231 | 232 | ||
| 232 | bool is_compressed = false; | 233 | bool is_compressed = false; |
| 233 | 234 | ||
| @@ -244,6 +245,8 @@ private: | |||
| 244 | NCCH_Header ncch_header; | 245 | NCCH_Header ncch_header; |
| 245 | ExeFs_Header exefs_header; | 246 | ExeFs_Header exefs_header; |
| 246 | ExHeader_Header exheader_header; | 247 | ExHeader_Header exheader_header; |
| 248 | |||
| 249 | std::string filepath; | ||
| 247 | }; | 250 | }; |
| 248 | 251 | ||
| 249 | } // namespace Loader | 252 | } // namespace Loader |