mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-30 10:42:47 +01:00
content_archive: Pass and take NCASectionHeader instance by reference
Each header is 512 bytes in size, which is kind of an excessive amount to copy all the time when it's possible to avoid doing so.
This commit is contained in:
parent
78f2a6a9e1
commit
4783ad54de
2 changed files with 3 additions and 3 deletions
|
@ -167,7 +167,7 @@ boost::optional<Core::Crypto::Key128> NCA::GetTitlekey() {
|
||||||
return titlekey;
|
return titlekey;
|
||||||
}
|
}
|
||||||
|
|
||||||
VirtualFile NCA::Decrypt(NCASectionHeader s_header, VirtualFile in, u64 starting_offset) {
|
VirtualFile NCA::Decrypt(const NCASectionHeader& s_header, VirtualFile in, u64 starting_offset) {
|
||||||
if (!encrypted)
|
if (!encrypted)
|
||||||
return in;
|
return in;
|
||||||
|
|
||||||
|
@ -295,7 +295,7 @@ NCA::NCA(VirtualFile file_, VirtualFile bktr_base_romfs_, u64 bktr_base_ivfc_off
|
||||||
ivfc_offset = 0;
|
ivfc_offset = 0;
|
||||||
|
|
||||||
for (std::ptrdiff_t i = 0; i < number_sections; ++i) {
|
for (std::ptrdiff_t i = 0; i < number_sections; ++i) {
|
||||||
auto section = sections[i];
|
const auto& section = sections[i];
|
||||||
|
|
||||||
if (section.raw.header.filesystem_type == NCASectionFilesystemType::ROMFS) {
|
if (section.raw.header.filesystem_type == NCASectionFilesystemType::ROMFS) {
|
||||||
const std::size_t base_offset =
|
const std::size_t base_offset =
|
||||||
|
|
|
@ -109,7 +109,7 @@ private:
|
||||||
u8 GetCryptoRevision() const;
|
u8 GetCryptoRevision() const;
|
||||||
boost::optional<Core::Crypto::Key128> GetKeyAreaKey(NCASectionCryptoType type) const;
|
boost::optional<Core::Crypto::Key128> GetKeyAreaKey(NCASectionCryptoType type) const;
|
||||||
boost::optional<Core::Crypto::Key128> GetTitlekey();
|
boost::optional<Core::Crypto::Key128> GetTitlekey();
|
||||||
VirtualFile Decrypt(NCASectionHeader header, VirtualFile in, u64 starting_offset);
|
VirtualFile Decrypt(const NCASectionHeader& header, VirtualFile in, u64 starting_offset);
|
||||||
|
|
||||||
std::vector<VirtualDir> dirs;
|
std::vector<VirtualDir> dirs;
|
||||||
std::vector<VirtualFile> files;
|
std::vector<VirtualFile> files;
|
||||||
|
|
Loading…
Reference in a new issue