diff --git a/src/common/memory_patcher.cpp b/src/common/memory_patcher.cpp index ca9d5bf6e..2c62a7e6f 100644 --- a/src/common/memory_patcher.cpp +++ b/src/common/memory_patcher.cpp @@ -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 \ No newline at end of file diff --git a/src/common/memory_patcher.h b/src/common/memory_patcher.h index 80f8e44af..f9f76a324 100644 --- a/src/common/memory_patcher.h +++ b/src/common/memory_patcher.h @@ -19,6 +19,7 @@ extern std::vector 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 \ No newline at end of file diff --git a/src/qt_gui/cheats_patches.cpp b/src/qt_gui/cheats_patches.cpp index 5205a68cd..a826db40a 100644 --- a/src/qt_gui/cheats_patches.cpp +++ b/src/qt_gui/cheats_patches.cpp @@ -26,9 +26,9 @@ #include #include #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;