From ccf0c4ab7b412ab7b98ae7d772d289bea6f23895 Mon Sep 17 00:00:00 2001 From: Visual Ehrmanntraut <30368284+VisualEhrmanntraut@users.noreply.github.com> Date: Fri, 23 Feb 2024 21:20:28 +0200 Subject: [PATCH] Fix memory corruption & panic on Navi 21 #11 Signed-off-by: Visual Ehrmanntraut <30368284+VisualEhrmanntraut@users.noreply.github.com> --- NootRX/HWLibs.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/NootRX/HWLibs.cpp b/NootRX/HWLibs.cpp index 4f291bc..1fd118b 100644 --- a/NootRX/HWLibs.cpp +++ b/NootRX/HWLibs.cpp @@ -166,7 +166,7 @@ bool HWLibs::processKext(KernelPatcher &patcher, size_t id, mach_vm_address_t sl size_t dataOffset; PANIC_COND(!KernelPatcher::findPattern(find, mask, arrsize(find), reinterpret_cast(slide), size, &dataOffset), - "HWLibs", "Failed to find memcpy block 0x%X&0x%X", arg1, arg1Mask); + "HWLibs", "Failed to find memcpy block 0x%04X&0x%04X", arg1, arg1Mask); auto block = slide + dataOffset; //! movabs rsi, ident *reinterpret_cast(block) = 0xBE48; @@ -241,7 +241,7 @@ const char *HWLibs::wrapGetMatchProperty() { } CAILResult HWLibs::wrapPspCmdKmSubmit(void *ctx, void *cmd, void *param3, void *param4) { - char filename[128] = {0}; + char filename[64] = {0}; auto &size = getMember(cmd, 0xC); auto cmdID = getMember(cmd, 0x0); size_t off; @@ -250,7 +250,7 @@ CAILResult HWLibs::wrapPspCmdKmSubmit(void *ctx, void *cmd, void *param3, void * off = 0xAF8; break; case KernelVersion::Ventura... KernelVersion::Sonoma: - off = 0xB48; + off = NootRXMain::callback->chipType == ChipType::Navi21 ? 0xAF8 : 0xB48; break; default: PANIC("HWLibs", "Unsupported kernel version %d", getKernelVersion());