summaryrefslogtreecommitdiffstats
path: root/src/core/file_sys/content_archive.cpp
diff options
context:
space:
mode:
authorZach Hilman <zachhilman@gmail.com>2018-08-24 00:53:13 +0200
committerZach Hilman <zachhilman@gmail.com>2018-08-24 00:53:13 +0200
commit4f18c17df77e791d30cc8c919108315610f315ef (patch)
treefc7b487b8ab4311f8a09c73197f2c8e7cfdc546f /src/core/file_sys/content_archive.cpp
parentkey_manager: Eliminate indexed for loop (diff)
downloadyuzu-4f18c17df77e791d30cc8c919108315610f315ef.tar
yuzu-4f18c17df77e791d30cc8c919108315610f315ef.tar.gz
yuzu-4f18c17df77e791d30cc8c919108315610f315ef.tar.bz2
yuzu-4f18c17df77e791d30cc8c919108315610f315ef.tar.lz
yuzu-4f18c17df77e791d30cc8c919108315610f315ef.tar.xz
yuzu-4f18c17df77e791d30cc8c919108315610f315ef.tar.zst
yuzu-4f18c17df77e791d30cc8c919108315610f315ef.zip
Diffstat (limited to '')
-rw-r--r--src/core/file_sys/content_archive.cpp8
1 files changed, 8 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_)) {
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;
}