diff options
author | Sebastian Valle <subv2112@gmail.com> | 2017-10-06 19:19:20 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-06 19:19:20 +0200 |
commit | 74d4050924e63f98c76570cafb5a6ad95d2ea5b1 (patch) | |
tree | aab85b74fdb13cc49a7427996b2d1cca17c3fbc3 /src/core/file_sys/ncch_container.h | |
parent | Merge pull request #2953 from Subv/applet_launch (diff) | |
parent | file_sys, loader: add support for reading TMDs to determine app paths (diff) | |
download | yuzu-74d4050924e63f98c76570cafb5a6ad95d2ea5b1.tar yuzu-74d4050924e63f98c76570cafb5a6ad95d2ea5b1.tar.gz yuzu-74d4050924e63f98c76570cafb5a6ad95d2ea5b1.tar.bz2 yuzu-74d4050924e63f98c76570cafb5a6ad95d2ea5b1.tar.lz yuzu-74d4050924e63f98c76570cafb5a6ad95d2ea5b1.tar.xz yuzu-74d4050924e63f98c76570cafb5a6ad95d2ea5b1.tar.zst yuzu-74d4050924e63f98c76570cafb5a6ad95d2ea5b1.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/file_sys/ncch_container.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/core/file_sys/ncch_container.h b/src/core/file_sys/ncch_container.h index 8af9032b4..2cc9d13dc 100644 --- a/src/core/file_sys/ncch_container.h +++ b/src/core/file_sys/ncch_container.h @@ -180,6 +180,13 @@ public: Loader::ResultStatus Load(); /** + * Attempt to find overridden sections for the NCCH and mark the container as tainted + * if any are found. + * @return ResultStatus result of function + */ + Loader::ResultStatus LoadOverrides(); + + /** * Reads an application ExeFS section of an NCCH file (e.g. .code, .logo, etc.) * @param name Name of section to read out of NCCH file * @param buffer Vector to read data into @@ -188,6 +195,15 @@ public: Loader::ResultStatus LoadSectionExeFS(const char* name, std::vector<u8>& buffer); /** + * Reads an application ExeFS section from external files instead of an NCCH file, + * (e.g. code.bin, logo.bcma.lz, icon.icn, banner.bnr) + * @param name Name of section to read from external files + * @param buffer Vector to read data into + * @return ResultStatus result of function + */ + Loader::ResultStatus LoadOverrideExeFSSection(const char* name, std::vector<u8>& buffer); + + /** * Get the RomFS of the NCCH container * Since the RomFS can be huge, we return a file reference instead of copying to a buffer * @param romfs_file The file containing the RomFS @@ -199,6 +215,17 @@ public: u64& size); /** + * Get the override RomFS of the NCCH container + * Since the RomFS can be huge, we return a file reference instead of copying to a buffer + * @param romfs_file The file containing the RomFS + * @param offset The offset the romfs begins on + * @param size The size of the romfs + * @return ResultStatus result of function + */ + Loader::ResultStatus ReadOverrideRomFS(std::shared_ptr<FileUtil::IOFile>& romfs_file, + u64& offset, u64& size); + + /** * Get the Program ID of the NCCH container * @return ResultStatus result of function */ @@ -227,10 +254,12 @@ public: ExHeader_Header exheader_header; private: + bool has_header = false; bool has_exheader = false; bool has_exefs = false; bool has_romfs = false; + bool is_tainted = false; // Are there parts of this container being overridden? bool is_loaded = false; bool is_compressed = false; @@ -239,6 +268,7 @@ private: std::string filepath; FileUtil::IOFile file; + FileUtil::IOFile exefs_file; }; } // namespace FileSys |