patch_manager: Dump NSO name with build ID
This commit is contained in:
parent
41d2565f29
commit
552d5071fa
4 changed files with 11 additions and 9 deletions
|
@ -20,6 +20,8 @@
|
|||
#include "core/memory.h"
|
||||
#include "core/settings.h"
|
||||
|
||||
#pragma optimize("", off)
|
||||
|
||||
namespace Loader {
|
||||
namespace {
|
||||
struct MODHeader {
|
||||
|
@ -139,13 +141,13 @@ std::optional<VAddr> AppLoader_NSO::LoadModule(Kernel::Process& process,
|
|||
|
||||
// Apply patches if necessary
|
||||
if (pm && (pm->HasNSOPatch(nso_header.build_id) || Settings::values.dump_nso)) {
|
||||
std::vector<u8> pi_header(sizeof(NSOHeader) + program_image.size());
|
||||
std::vector<u8> pi_header;
|
||||
pi_header.insert(pi_header.begin(), reinterpret_cast<u8*>(&nso_header),
|
||||
reinterpret_cast<u8*>(&nso_header) + sizeof(NSOHeader));
|
||||
pi_header.insert(pi_header.begin() + sizeof(NSOHeader), program_image.begin(),
|
||||
program_image.end());
|
||||
|
||||
pi_header = pm->PatchNSO(pi_header);
|
||||
pi_header = pm->PatchNSO(pi_header, file.GetName());
|
||||
|
||||
std::copy(pi_header.begin() + sizeof(NSOHeader), pi_header.end(), program_image.begin());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue