Merge pull request #1618 from DarkLordZach/dump-nso

patch_manager: Add support for dumping uncompressed NSOs
This commit is contained in:
bunnei 2018-11-15 14:46:10 -08:00 committed by GitHub
commit 97605e36f7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 75 additions and 8 deletions

View file

@ -154,7 +154,7 @@ std::optional<VAddr> AppLoader_NSO::LoadModule(const FileSys::VfsFile& file, VAd
program_image.resize(image_size);
// Apply patches if necessary
if (pm && pm->HasNSOPatch(nso_header.build_id)) {
if (pm && (pm->HasNSOPatch(nso_header.build_id) || Settings::values.dump_nso)) {
std::vector<u8> pi_header(program_image.size() + 0x100);
std::memcpy(pi_header.data(), &nso_header, sizeof(NsoHeader));
std::memcpy(pi_header.data() + 0x100, program_image.data(), program_image.size());