diff options
author | bunnei <bunneidev@gmail.com> | 2018-11-15 23:46:10 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-15 23:46:10 +0100 |
commit | 97605e36f7c572d144a8c8f0a5e1beb8ca2b0f51 (patch) | |
tree | c6f69e9269a8e6c4771b1fb338c2677d62f7c48e /src/core/file_sys/patch_manager.cpp | |
parent | Merge pull request #1691 from lioncash/audren (diff) | |
parent | patch_manager: Add support for dumping decompressed NSOs (diff) | |
download | yuzu-97605e36f7c572d144a8c8f0a5e1beb8ca2b0f51.tar yuzu-97605e36f7c572d144a8c8f0a5e1beb8ca2b0f51.tar.gz yuzu-97605e36f7c572d144a8c8f0a5e1beb8ca2b0f51.tar.bz2 yuzu-97605e36f7c572d144a8c8f0a5e1beb8ca2b0f51.tar.lz yuzu-97605e36f7c572d144a8c8f0a5e1beb8ca2b0f51.tar.xz yuzu-97605e36f7c572d144a8c8f0a5e1beb8ca2b0f51.tar.zst yuzu-97605e36f7c572d144a8c8f0a5e1beb8ca2b0f51.zip |
Diffstat (limited to 'src/core/file_sys/patch_manager.cpp')
-rw-r--r-- | src/core/file_sys/patch_manager.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/core/file_sys/patch_manager.cpp b/src/core/file_sys/patch_manager.cpp index 0c1156989..8d062eb3e 100644 --- a/src/core/file_sys/patch_manager.cpp +++ b/src/core/file_sys/patch_manager.cpp @@ -19,6 +19,7 @@ #include "core/file_sys/vfs_vector.h" #include "core/hle/service/filesystem/filesystem.h" #include "core/loader/loader.h" +#include "core/settings.h" namespace FileSys { @@ -119,6 +120,18 @@ std::vector<u8> PatchManager::PatchNSO(const std::vector<u8>& nso) const { const auto build_id_raw = Common::HexArrayToString(header.build_id); const auto build_id = build_id_raw.substr(0, build_id_raw.find_last_not_of('0') + 1); + if (Settings::values.dump_nso) { + LOG_INFO(Loader, "Dumping NSO for build_id={}, title_id={:016X}", build_id, title_id); + const auto dump_dir = Service::FileSystem::GetModificationDumpRoot(title_id); + if (dump_dir != nullptr) { + const auto nso_dir = GetOrCreateDirectoryRelative(dump_dir, "/nso"); + const auto file = nso_dir->CreateFile(fmt::format("{}.nso", build_id)); + + file->Resize(nso.size()); + file->WriteBytes(nso); + } + } + LOG_INFO(Loader, "Patching NSO for build_id={}", build_id); const auto load_dir = Service::FileSystem::GetModificationLoadRoot(title_id); |