From 214ed6c0743da580270d7808e519d9a4bad8bc8f Mon Sep 17 00:00:00 2001 From: Maschell Date: Mon, 4 May 2026 19:57:20 +0200 Subject: [PATCH] Add more fiushed to be safe --- source/function_patcher.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/source/function_patcher.cpp b/source/function_patcher.cpp index 715102e..39bf5ff 100644 --- a/source/function_patcher.cpp +++ b/source/function_patcher.cpp @@ -63,6 +63,9 @@ bool PatchFunction(std::shared_ptr &patchedFunction) { return false; } + DCFlushRange(gJumpHeapData, JUMP_HEAP_DATA_SIZE); + ICInvalidateRange(gJumpHeapData, JUMP_HEAP_DATA_SIZE); + if (patchedFunction->functionName) { DEBUG_FUNCTION_LINE("Patching function %s...", patchedFunction->functionName->c_str()); } else { @@ -85,6 +88,9 @@ bool PatchFunction(std::shared_ptr &patchedFunction) { // Write this->replaceWithInstruction to the first instruction of the function we want to replace. CThread::runOnAllCores(writeDataAndFlushIC, patchedFunction.get()); + DCFlushRange(gJumpHeapData, JUMP_HEAP_DATA_SIZE); + ICInvalidateRange(gJumpHeapData, JUMP_HEAP_DATA_SIZE); + // Set patch status patchedFunction->isPatched = true;