mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-08-02 07:22:24 +00:00
format
This commit is contained in:
parent
06f6082bc1
commit
fbe7f6d388
@ -1,8 +1,7 @@
|
||||
#include "memory_patcher.h"
|
||||
#include "common/logging/log.h"
|
||||
#include "memory_patcher.h"
|
||||
|
||||
namespace MemoryPatcher
|
||||
{
|
||||
namespace MemoryPatcher {
|
||||
|
||||
uintptr_t g_eboot_address;
|
||||
|
||||
@ -25,8 +24,7 @@ void ApplyPendingPatches() {
|
||||
|
||||
void PatchMemory(std::string modNameStr, std::string offsetStr, std::string valueStr) {
|
||||
// Send a request to modify the process memory.
|
||||
void* cheatAddress =
|
||||
reinterpret_cast<void*>(g_eboot_address + std::stoi(offsetStr, 0, 16));
|
||||
void* cheatAddress = reinterpret_cast<void*>(g_eboot_address + std::stoi(offsetStr, 0, 16));
|
||||
|
||||
std::vector<unsigned char> bytePatch;
|
||||
|
||||
@ -38,7 +36,8 @@ void PatchMemory(std::string modNameStr, std::string offsetStr, std::string valu
|
||||
}
|
||||
std::memcpy(cheatAddress, bytePatch.data(), bytePatch.size());
|
||||
|
||||
LOG_INFO(Loader, "Applied patch:{}, Offset:{}, Value:{}", modNameStr, (uintptr_t)cheatAddress, valueStr);
|
||||
LOG_INFO(Loader, "Applied patch:{}, Offset:{}, Value:{}", modNameStr, (uintptr_t)cheatAddress,
|
||||
valueStr);
|
||||
}
|
||||
|
||||
}
|
||||
} // namespace MemoryPatcher
|
@ -1,10 +1,10 @@
|
||||
#pragma once
|
||||
#include <cstring>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace MemoryPatcher {
|
||||
|
||||
namespace MemoryPatcher
|
||||
{
|
||||
extern uintptr_t g_eboot_address;
|
||||
|
||||
struct patchInfo {
|
||||
@ -20,5 +20,4 @@ namespace MemoryPatcher
|
||||
|
||||
void PatchMemory(std::string modNameStr, std::string offsetStr, std::string valueStr);
|
||||
|
||||
|
||||
}
|
||||
} // namespace MemoryPatcher
|
@ -5,13 +5,13 @@
|
||||
#include "common/alignment.h"
|
||||
#include "common/assert.h"
|
||||
#include "common/logging/log.h"
|
||||
#include "common/memory_patcher.h"
|
||||
#include "common/string_util.h"
|
||||
#include "core/aerolib/aerolib.h"
|
||||
#include "core/cpu_patches.h"
|
||||
#include "core/loader/dwarf.h"
|
||||
#include "core/memory.h"
|
||||
#include "core/module.h"
|
||||
#include "common/memory_patcher.h"
|
||||
|
||||
namespace Core {
|
||||
|
||||
@ -197,11 +197,9 @@ void Module::LoadModuleToMemory(u32& max_tls_index) {
|
||||
if (MemoryPatcher::g_eboot_address == 0) {
|
||||
if (name == "eboot") {
|
||||
MemoryPatcher::g_eboot_address = base_virtual_addr;
|
||||
|
||||
MemoryPatcher::ApplyPendingPatches();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void Module::LoadDynamicInfo() {
|
||||
|
Loading…
Reference in New Issue
Block a user