summaryrefslogtreecommitdiff
path: root/src/core/loader/ncch.cpp
diff options
context:
space:
mode:
authorGravatar bunnei2016-04-15 17:13:34 -0400
committerGravatar bunnei2016-04-15 17:13:34 -0400
commit2b422fbcc5bccae22f2a80afe654dc7f7cefcd7a (patch)
tree8d5e1dcea725aae28e20939037b05fa3c0ecc32d /src/core/loader/ncch.cpp
parentMerge pull request #1673 from MerryMage/config-minimumSize (diff)
parentncch:only decompress .code section (diff)
downloadyuzu-2b422fbcc5bccae22f2a80afe654dc7f7cefcd7a.tar.gz
yuzu-2b422fbcc5bccae22f2a80afe654dc7f7cefcd7a.tar.xz
yuzu-2b422fbcc5bccae22f2a80afe654dc7f7cefcd7a.zip
Merge pull request #1667 from wwylele/ncch-loader-fix
loader: only decompress code section
Diffstat (limited to 'src/core/loader/ncch.cpp')
-rw-r--r--src/core/loader/ncch.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core/loader/ncch.cpp b/src/core/loader/ncch.cpp
index e63cab33f..a4b47ef8c 100644
--- a/src/core/loader/ncch.cpp
+++ b/src/core/loader/ncch.cpp
@@ -174,7 +174,7 @@ ResultStatus AppLoader_NCCH::LoadSectionExeFS(const char* name, std::vector<u8>&
174 return ResultStatus::Error; 174 return ResultStatus::Error;
175 175
176 LOG_DEBUG(Loader, "%d sections:", kMaxSections); 176 LOG_DEBUG(Loader, "%d sections:", kMaxSections);
177 // Iterate through the ExeFs archive until we find the .code file... 177 // Iterate through the ExeFs archive until we find a section with the specified name...
178 for (unsigned section_number = 0; section_number < kMaxSections; section_number++) { 178 for (unsigned section_number = 0; section_number < kMaxSections; section_number++) {
179 const auto& section = exefs_header.section[section_number]; 179 const auto& section = exefs_header.section[section_number];
180 180
@@ -186,7 +186,7 @@ ResultStatus AppLoader_NCCH::LoadSectionExeFS(const char* name, std::vector<u8>&
186 s64 section_offset = (section.offset + exefs_offset + sizeof(ExeFs_Header) + ncch_offset); 186 s64 section_offset = (section.offset + exefs_offset + sizeof(ExeFs_Header) + ncch_offset);
187 file.Seek(section_offset, SEEK_SET); 187 file.Seek(section_offset, SEEK_SET);
188 188
189 if (is_compressed) { 189 if (strcmp(section.name, ".code") == 0 && is_compressed) {
190 // Section is compressed, read compressed .code section... 190 // Section is compressed, read compressed .code section...
191 std::unique_ptr<u8[]> temp_buffer; 191 std::unique_ptr<u8[]> temp_buffer;
192 try { 192 try {