From 551144ddbd401afaf8d597cc365e43bda985f6b2 Mon Sep 17 00:00:00 2001 From: Maschell Date: Thu, 23 Sep 2021 23:05:15 +0200 Subject: [PATCH] Do an OSFatal if the getting the PA from EA fails --- source/function_patcher.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/function_patcher.cpp b/source/function_patcher.cpp index 2443d91..6141f4c 100644 --- a/source/function_patcher.cpp +++ b/source/function_patcher.cpp @@ -249,6 +249,10 @@ void FunctionPatcherRestoreFunctions(function_replacement_data_t *replacements, sourceAddrPhys = sourceAddr + 0x30800000 - 0x00800000; } + if(sourceAddrPhys == 0){ + OSFatal("Failed to get physical address"); + } + KernelCopyData(targetAddrPhys, sourceAddrPhys, 4); if (DEBUG_LOG_DYN) { WHBLogPrintf("");