summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar wwylele2016-04-14 16:53:51 +0300
committerGravatar wwylele2016-04-14 18:33:42 +0300
commit727d508e02415101d1f49a75858e35a49220e81b (patch)
tree71b773aa2fe210e111b3da11525b8af1152c9ee9
parentMerge pull request #1660 from MerryMage/file_util (diff)
downloadyuzu-727d508e02415101d1f49a75858e35a49220e81b.tar.gz
yuzu-727d508e02415101d1f49a75858e35a49220e81b.tar.xz
yuzu-727d508e02415101d1f49a75858e35a49220e81b.zip
ncch:only decompress .code section
-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 {