diff options
| author | Mat M <mathew1800@gmail.com> | 2018-08-24 23:47:46 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-08-24 23:47:46 -0400 |
| commit | 6426b0f5514d6a7c5cc369368947eceb380bfc85 (patch) | |
| tree | b7acdc39a4344570a6f2c098c30ad20114bf84db /src/core/file_sys/content_archive.cpp | |
| parent | f09da5d1c97d83b7e0654785ae49179ca6cd82be (diff) | |
| parent | 6314a799aa7e20789562d2e877949dfebb6194ce (diff) | |
Merge pull request #1094 from DarkLordZach/nax0
file_sys: Add support for NAX archives
Diffstat (limited to 'src/core/file_sys/content_archive.cpp')
| -rw-r--r-- | src/core/file_sys/content_archive.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/core/file_sys/content_archive.cpp b/src/core/file_sys/content_archive.cpp index 47afcad9b..e8b5d6ece 100644 --- a/src/core/file_sys/content_archive.cpp +++ b/src/core/file_sys/content_archive.cpp @@ -178,7 +178,7 @@ VirtualFile NCA::Decrypt(NCASectionHeader s_header, VirtualFile in, u64 starting return std::static_pointer_cast<VfsFile>(out); } case NCASectionCryptoType::XTS: - // TODO(DarkLordZach): Implement XTSEncryptionLayer. + // TODO(DarkLordZach): Find a test case for XTS-encrypted NCAs default: LOG_ERROR(Crypto, "called with unhandled crypto type={:02X}", static_cast<u8>(s_header.raw.header.crypto_type)); @@ -258,6 +258,10 @@ NCA::NCA(VirtualFile file_) : file(std::move(file_)) { file->ReadBytes(sections.data(), length_sections, SECTION_HEADER_OFFSET); } + is_update = std::find_if(sections.begin(), sections.end(), [](const NCASectionHeader& header) { + return header.raw.header.crypto_type == NCASectionCryptoType::BKTR; + }) != sections.end(); + for (std::ptrdiff_t i = 0; i < number_sections; ++i) { auto section = sections[i]; @@ -358,6 +362,10 @@ VirtualFile NCA::GetBaseFile() const { return file; } +bool NCA::IsUpdate() const { + return is_update; +} + bool NCA::ReplaceFileWithSubdirectory(VirtualFile file, VirtualDir dir) { return false; } |
