diff options
Diffstat (limited to 'src/core/loader/xci.cpp')
| -rw-r--r-- | src/core/loader/xci.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/core/loader/xci.cpp b/src/core/loader/xci.cpp index 75b998faa..b01d51abb 100644 --- a/src/core/loader/xci.cpp +++ b/src/core/loader/xci.cpp | |||
| @@ -8,6 +8,7 @@ | |||
| 8 | #include "core/file_sys/card_image.h" | 8 | #include "core/file_sys/card_image.h" |
| 9 | #include "core/file_sys/content_archive.h" | 9 | #include "core/file_sys/content_archive.h" |
| 10 | #include "core/file_sys/control_metadata.h" | 10 | #include "core/file_sys/control_metadata.h" |
| 11 | #include "core/file_sys/patch_manager.h" | ||
| 11 | #include "core/file_sys/romfs.h" | 12 | #include "core/file_sys/romfs.h" |
| 12 | #include "core/hle/kernel/process.h" | 13 | #include "core/hle/kernel/process.h" |
| 13 | #include "core/loader/nca.h" | 14 | #include "core/loader/nca.h" |
| @@ -20,10 +21,18 @@ AppLoader_XCI::AppLoader_XCI(FileSys::VirtualFile file) | |||
| 20 | nca_loader(std::make_unique<AppLoader_NCA>(xci->GetProgramNCAFile())) { | 21 | nca_loader(std::make_unique<AppLoader_NCA>(xci->GetProgramNCAFile())) { |
| 21 | if (xci->GetStatus() != ResultStatus::Success) | 22 | if (xci->GetStatus() != ResultStatus::Success) |
| 22 | return; | 23 | return; |
| 24 | |||
| 23 | const auto control_nca = xci->GetNCAByType(FileSys::NCAContentType::Control); | 25 | const auto control_nca = xci->GetNCAByType(FileSys::NCAContentType::Control); |
| 26 | |||
| 24 | if (control_nca == nullptr || control_nca->GetStatus() != ResultStatus::Success) | 27 | if (control_nca == nullptr || control_nca->GetStatus() != ResultStatus::Success) |
| 25 | return; | 28 | return; |
| 26 | const auto romfs = FileSys::ExtractRomFS(control_nca->GetRomFS()); | 29 | |
| 30 | auto romfs_raw = control_nca->GetRomFS(); | ||
| 31 | FileSys::PatchManager patch{xci->GetNCAByType(FileSys::NCAContentType::Program)->GetTitleId()}; | ||
| 32 | romfs_raw = patch.PatchRomFS(romfs_raw, control_nca->GetBaseIVFCOffset(), | ||
| 33 | FileSys::ContentRecordType::Control); | ||
| 34 | |||
| 35 | const auto romfs = FileSys::ExtractRomFS(romfs_raw); | ||
| 27 | if (romfs == nullptr) | 36 | if (romfs == nullptr) |
| 28 | return; | 37 | return; |
| 29 | for (const auto& language : FileSys::LANGUAGE_NAMES) { | 38 | for (const auto& language : FileSys::LANGUAGE_NAMES) { |