mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-04-21 12:04:45 +00:00
format
This commit is contained in:
parent
90f1d2c08f
commit
0c1c3d7a83
3 changed files with 8 additions and 6 deletions
|
@ -13,16 +13,17 @@ void AddPatchToQueue(patchInfo patchToAdd) {
|
|||
|
||||
void ApplyPendingPatches() {
|
||||
|
||||
for (size_t i = 0; i < pending_patches.size(); ++i) {
|
||||
for (size_t i = 0; i < pending_patches.size(); ++i) {
|
||||
patchInfo currentPatch = pending_patches[i];
|
||||
PatchMemory(currentPatch.modNameStr, currentPatch.offsetStr, currentPatch.valueStr,
|
||||
currentPatch.isOffset);
|
||||
currentPatch.isOffset);
|
||||
}
|
||||
|
||||
pending_patches.clear();
|
||||
}
|
||||
|
||||
void PatchMemory(std::string modNameStr, std::string offsetStr, std::string valueStr, bool isOffset) {
|
||||
void PatchMemory(std::string modNameStr, std::string offsetStr, std::string valueStr,
|
||||
bool isOffset) {
|
||||
// Send a request to modify the process memory.
|
||||
void* cheatAddress = nullptr;
|
||||
|
||||
|
@ -44,7 +45,7 @@ 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);
|
||||
valueStr);
|
||||
}
|
||||
|
||||
} // namespace MemoryPatcher
|
|
@ -19,6 +19,7 @@ extern std::vector<patchInfo> pending_patches;
|
|||
void AddPatchToQueue(patchInfo patchToAdd);
|
||||
void ApplyPendingPatches();
|
||||
|
||||
void PatchMemory(std::string modNameStr, std::string offsetStr, std::string valueStr, bool isOffset);
|
||||
void PatchMemory(std::string modNameStr, std::string offsetStr, std::string valueStr,
|
||||
bool isOffset);
|
||||
|
||||
} // namespace MemoryPatcher
|
|
@ -26,9 +26,9 @@
|
|||
#include <QXmlStreamReader>
|
||||
#include <common/logging/log.h>
|
||||
#include "cheats_patches.h"
|
||||
#include "common/memory_patcher.h"
|
||||
#include "common/path_util.h"
|
||||
#include "core/module.h"
|
||||
#include "common/memory_patcher.h"
|
||||
|
||||
using namespace Common::FS;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue