diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/file_sys/content_archive.cpp | 8 | ||||
| -rw-r--r-- | src/core/file_sys/content_archive.h | 3 |
2 files changed, 11 insertions, 0 deletions
diff --git a/src/core/file_sys/content_archive.cpp b/src/core/file_sys/content_archive.cpp index 008e11d8c..e8b5d6ece 100644 --- a/src/core/file_sys/content_archive.cpp +++ b/src/core/file_sys/content_archive.cpp | |||
| @@ -258,6 +258,10 @@ NCA::NCA(VirtualFile file_) : file(std::move(file_)) { | |||
| 258 | file->ReadBytes(sections.data(), length_sections, SECTION_HEADER_OFFSET); | 258 | file->ReadBytes(sections.data(), length_sections, SECTION_HEADER_OFFSET); |
| 259 | } | 259 | } |
| 260 | 260 | ||
| 261 | is_update = std::find_if(sections.begin(), sections.end(), [](const NCASectionHeader& header) { | ||
| 262 | return header.raw.header.crypto_type == NCASectionCryptoType::BKTR; | ||
| 263 | }) != sections.end(); | ||
| 264 | |||
| 261 | for (std::ptrdiff_t i = 0; i < number_sections; ++i) { | 265 | for (std::ptrdiff_t i = 0; i < number_sections; ++i) { |
| 262 | auto section = sections[i]; | 266 | auto section = sections[i]; |
| 263 | 267 | ||
| @@ -358,6 +362,10 @@ VirtualFile NCA::GetBaseFile() const { | |||
| 358 | return file; | 362 | return file; |
| 359 | } | 363 | } |
| 360 | 364 | ||
| 365 | bool NCA::IsUpdate() const { | ||
| 366 | return is_update; | ||
| 367 | } | ||
| 368 | |||
| 361 | bool NCA::ReplaceFileWithSubdirectory(VirtualFile file, VirtualDir dir) { | 369 | bool NCA::ReplaceFileWithSubdirectory(VirtualFile file, VirtualDir dir) { |
| 362 | return false; | 370 | return false; |
| 363 | } | 371 | } |
diff --git a/src/core/file_sys/content_archive.h b/src/core/file_sys/content_archive.h index 4b74c54ec..b961cfde7 100644 --- a/src/core/file_sys/content_archive.h +++ b/src/core/file_sys/content_archive.h | |||
| @@ -93,6 +93,8 @@ public: | |||
| 93 | 93 | ||
| 94 | VirtualFile GetBaseFile() const; | 94 | VirtualFile GetBaseFile() const; |
| 95 | 95 | ||
| 96 | bool IsUpdate() const; | ||
| 97 | |||
| 96 | protected: | 98 | protected: |
| 97 | bool ReplaceFileWithSubdirectory(VirtualFile file, VirtualDir dir) override; | 99 | bool ReplaceFileWithSubdirectory(VirtualFile file, VirtualDir dir) override; |
| 98 | 100 | ||
| @@ -111,6 +113,7 @@ private: | |||
| 111 | 113 | ||
| 112 | NCAHeader header{}; | 114 | NCAHeader header{}; |
| 113 | bool has_rights_id{}; | 115 | bool has_rights_id{}; |
| 116 | bool is_update{}; | ||
| 114 | 117 | ||
| 115 | Loader::ResultStatus status{}; | 118 | Loader::ResultStatus status{}; |
| 116 | 119 | ||