summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/file_sys/registered_cache.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/core/file_sys/registered_cache.cpp b/src/core/file_sys/registered_cache.cpp
index e42b677f7..a97f079c0 100644
--- a/src/core/file_sys/registered_cache.cpp
+++ b/src/core/file_sys/registered_cache.cpp
@@ -621,25 +621,25 @@ InstallResult RegisteredCache::InstallEntry(const NSP& nsp, bool overwrite_if_ex
621 621
622InstallResult RegisteredCache::InstallEntry(const NCA& nca, TitleType type, 622InstallResult RegisteredCache::InstallEntry(const NCA& nca, TitleType type,
623 bool overwrite_if_exists, const VfsCopyFunction& copy) { 623 bool overwrite_if_exists, const VfsCopyFunction& copy) {
624 CNMTHeader header{ 624 const CNMTHeader header{
625 nca.GetTitleId(), // Title ID 625 .title_id = nca.GetTitleId(),
626 0, // Ignore/Default title version 626 .title_version = 0,
627 type, // Type 627 .type = type,
628 {}, // Padding 628 .reserved = {},
629 0x10, // Default table offset 629 .table_offset = 0x10,
630 1, // 1 Content Entry 630 .number_content_entries = 1,
631 0, // No Meta Entries 631 .number_meta_entries = 0,
632 {}, // Padding 632 .attributes = 0,
633 {}, // Reserved 1 633 .reserved2 = {},
634 0, // Is committed 634 .is_committed = 0,
635 0, // Required download system version 635 .required_download_system_version = 0,
636 {}, // Reserved 2 636 .reserved3 = {},
637 }; 637 };
638 OptionalHeader opt_header{0, 0}; 638 const OptionalHeader opt_header{0, 0};
639 ContentRecord c_rec{{}, {}, {}, GetCRTypeFromNCAType(nca.GetType()), {}}; 639 ContentRecord c_rec{{}, {}, {}, GetCRTypeFromNCAType(nca.GetType()), {}};
640 const auto& data = nca.GetBaseFile()->ReadBytes(0x100000); 640 const auto& data = nca.GetBaseFile()->ReadBytes(0x100000);
641 mbedtls_sha256_ret(data.data(), data.size(), c_rec.hash.data(), 0); 641 mbedtls_sha256_ret(data.data(), data.size(), c_rec.hash.data(), 0);
642 memcpy(&c_rec.nca_id, &c_rec.hash, 16); 642 std::memcpy(&c_rec.nca_id, &c_rec.hash, 16);
643 const CNMT new_cnmt(header, opt_header, {c_rec}, {}); 643 const CNMT new_cnmt(header, opt_header, {c_rec}, {});
644 if (!RawInstallYuzuMeta(new_cnmt)) { 644 if (!RawInstallYuzuMeta(new_cnmt)) {
645 return InstallResult::ErrorMetaFailed; 645 return InstallResult::ErrorMetaFailed;