From 182c6d2f922662d79527a5b4740e377c28b2821f Mon Sep 17 00:00:00 2001 From: Maschell Date: Sun, 1 Jan 2023 15:37:27 +0100 Subject: [PATCH] Check if the function is already patched before updating the addresses --- source/function_patcher.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/function_patcher.cpp b/source/function_patcher.cpp index 33fa16e..7ad9779 100644 --- a/source/function_patcher.cpp +++ b/source/function_patcher.cpp @@ -31,12 +31,12 @@ static void writeDataAndFlushIC(CThread *thread, void *arg) { } bool PatchFunction(std::shared_ptr &patchedFunction) { - // The addresses of a function might change every time with run another application. - if (!patchedFunction->updateFunctionAddresses()) { + if (patchedFunction->isPatched) { return true; } - if (patchedFunction->isPatched) { + // The addresses of a function might change every time with run another application. + if (!patchedFunction->updateFunctionAddresses()) { return true; }