From b1cf08c9025b2f8dee8908b7c35dacbf7dda06d3 Mon Sep 17 00:00:00 2001 From: vit9696 Date: Mon, 1 Apr 2019 16:20:55 +0300 Subject: [PATCH] OcAppleKernelImageLib: Fix _kmod_info stab handling --- Library/OcAppleKernelLib/PrelinkedContext.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Library/OcAppleKernelLib/PrelinkedContext.c b/Library/OcAppleKernelLib/PrelinkedContext.c index 89208c78..344e207e 100644 --- a/Library/OcAppleKernelLib/PrelinkedContext.c +++ b/Library/OcAppleKernelLib/PrelinkedContext.c @@ -108,12 +108,14 @@ PrelinkedFindKmodAddress ( return 0; } - SymbolName = MachoGetSymbolName64 (ExecutableContext, Symbol); - if (SymbolName && AsciiStrCmp (SymbolName, "_kmod_info") == 0) { - if (!MachoIsSymbolValueInRange64 (ExecutableContext, Symbol)) { - return 0; + if ((Symbol->Type & MACH_N_TYPE_STAB) == 0) { + SymbolName = MachoGetSymbolName64 (ExecutableContext, Symbol); + if (SymbolName && AsciiStrCmp (SymbolName, "_kmod_info") == 0) { + if (!MachoIsSymbolValueInRange64 (ExecutableContext, Symbol)) { + return 0; + } + break; } - break; } Index++;