Matgen84 Posted January 23, 2019 Share Posted January 23, 2019 10 hours ago, apianti said: Don't confuse the high definition audio controller chipset with the high definition audio codec chipset. Ok. With bootchimecfg.efi, I"ve got sound on green rear Line out. But with commits 4859: no more sound with first Line output select in audio output parameters . Link to comment Share on other sites More sharing options...
Matgen84 Posted January 23, 2019 Share Posted January 23, 2019 16 hours ago, Slice said: You are right, this is a bug will be corrected. There is the same issue with Audio Tuning: Clover don't save changing HDALayoutId after restart on my system. Despite the explanation of Apianti, I do not understand why there is no ALC892 in the devices. Link to comment Share on other sites More sharing options...
Slice Posted January 23, 2019 Share Posted January 23, 2019 19 minutes ago, Matgen84 said: There is the same issue with Audio Tuning: Clover don't save changing HDALayoutId after restart on my system. Despite the explanation of Apianti, I do not understand why there is no ALC892 in the devices. The issue should be debugged. First I want to see your boot.log. @All Sound 8000Hz has a bad quality but I include it into release because of space. If you want a better quality place sound.wav 44100 into your theme folder. Embedded theme is an exclusion. It has no own folder to download files and so embedded sound can't be replaced. Use other theme or build own clover with own sound.c sources. Beware the size! 13 hours ago, tluck said: Question: is there a way to set display Menu ratio X:Y ? my native screen is FHD 1920x1080 (16:9 = 1.778) but i have to boot with 1280x1024 (1.25) or 1024x768 (1.333) so everything looks squashed. I am using Clovy - so it may be adjustable? - I see scale multipliers but not sure for non-uniform x vs y. Clover uses square pixels in any case of vector themes. Screen will be any ratio and background will be scaled in the same ration in X and Y then cropped. 2 Link to comment Share on other sites More sharing options...
Sherlocks Posted January 23, 2019 Share Posted January 23, 2019 Clover uses square pixels in any case of vector themes. Screen will be any ratio and background will be scaled in the same ration in X and Y then cropped.can we play boot sound with 8000hz like itunes?i remember when clover first include audiopkg source, sound is no problem. isn't it right?나의 LG-F800S 의 Tapatalk에서 보냄 Link to comment Share on other sites More sharing options...
Slice Posted January 23, 2019 Share Posted January 23, 2019 I think iTune also converted sounds because sound card has own abilities Playback: Stream cap: 0x00000001 PCM PCM cap: 0x000e0560 16 20 24 bits, 44 48 96 192 KHz DAC: 2 4 3 5 2 Link to comment Share on other sites More sharing options...
Matgen84 Posted January 23, 2019 Share Posted January 23, 2019 49 minutes ago, Slice said: The issue should be debugged. First I want to see your boot.log. Here is the boot.log file preboot.log.zip Link to comment Share on other sites More sharing options...
Andres ZeroCross Posted January 23, 2019 Share Posted January 23, 2019 10:581 0:000 === [ InitTheme ] ========================================= 10:581 0:000 use daylight theme 12:994 2:412 Theme view-bounds: w=1366 h=768 units=px 12:994 0:000 using scale 1.406250 12:994 0:000 theme contains font-family=PTMono-Regular 13:048 0:054 Banner position at parse [594,164] 13:052 0:004 parsed banner->width=741 13:065 0:012 icon 9 not parsed take common icons\tool_part 13:065 0:000 icon 10 not parsed take common icons\tool_rescue 13:068 0:003 icon 15 not parsed take common icons\vol_firewire 13:078 0:010 icon main size=[203,203] 13:086 0:007 OSicon os_tiger not parsed 13:228 0:141 parsing theme finish 13:228 0:000 Using vector theme 'BGM_SVG' (EFI\CLOVER\themes\BGM_SVG) 13:235 0:006 Channels: 2 Sample rate: 48000 Hz Bits: 16 13:235 0:000 output to channel 6 with volume 70, len=893316 13:235 0:000 sound channels=2 bits=16 freq=4800013:235 0:000 StartupSound: Error setting up playback: Invalid Parameter 13:235 0:000 theme inited 13:235 0:000 Chosen theme BGM_SVG I have sound.wav and sound_night.wav in BGM_SVG Theme folder,, choose 7 (LineOut Rear) as Output Device in CLOVER. And i used Clover r4859 - No Sound before GUI CLOVER - No Sound / Effect when Press F7 in GUI CLOVER or in Sound Boot Options. Thankss.. 1 Link to comment Share on other sites More sharing options...
Matgen84 Posted January 23, 2019 Share Posted January 23, 2019 43 minutes ago, Andres ZeroCross said: 10:581 0:000 === [ InitTheme ] ========================================= 10:581 0:000 use daylight theme 12:994 2:412 Theme view-bounds: w=1366 h=768 units=px 12:994 0:000 using scale 1.406250 12:994 0:000 theme contains font-family=PTMono-Regular 13:048 0:054 Banner position at parse [594,164] 13:052 0:004 parsed banner->width=741 13:065 0:012 icon 9 not parsed take common icons\tool_part 13:065 0:000 icon 10 not parsed take common icons\tool_rescue 13:068 0:003 icon 15 not parsed take common icons\vol_firewire 13:078 0:010 icon main size=[203,203] 13:086 0:007 OSicon os_tiger not parsed 13:228 0:141 parsing theme finish 13:228 0:000 Using vector theme 'BGM_SVG' (EFI\CLOVER\themes\BGM_SVG) 13:235 0:006 Channels: 2 Sample rate: 48000 Hz Bits: 16 13:235 0:000 output to channel 6 with volume 70, len=893316 13:235 0:000 sound channels=2 bits=16 freq=4800013:235 0:000 StartupSound: Error setting up playback: Invalid Parameter 13:235 0:000 theme inited 13:235 0:000 Chosen theme BGM_SVG I have sound.wav and sound_night.wav in BGM_SVG Theme folder,, choose 7 (LineOut Rear) as Output Device in CLOVER. And i used Clover r4859 - No Sound before GUI CLOVER - No Sound / Effect when Press F7 in GUI CLOVER or in Sound Boot Options. Thankss.. Do you try PlayAsync to false parameters in config.plist. Link to comment Share on other sites More sharing options...
Andres ZeroCross Posted January 23, 2019 Share Posted January 23, 2019 32 minutes ago, Matgen84 said: Do you try PlayAsync to false parameters in config.plist. Yes,, 1 Link to comment Share on other sites More sharing options...
Slice Posted January 23, 2019 Share Posted January 23, 2019 Test please the follow change in StartupSound.c, line 193 - Status = AudioIo->SetupPlayback(AudioIo, OutputIndex, OutputVolume, + Status = AudioIo->SetupPlayback(AudioIo, AudioList[OutputIndex].Index, OutputVolume, I am not at home now... 1 Link to comment Share on other sites More sharing options...
Matgen84 Posted January 23, 2019 Share Posted January 23, 2019 (edited) 2 hours ago, Slice said: Test please the follow change in StartupSound.c, line 193 - Status = AudioIo->SetupPlayback(AudioIo, OutputIndex, OutputVolume, + Status = AudioIo->SetupPlayback(AudioIo, AudioList[OutputIndex].Index, OutputVolume, I am not at home now... Ok. I do that and report. EDIT: Works fine. Thanks Edited January 23, 2019 by Matgen84 Link to comment Share on other sites More sharing options...
Matgen84 Posted January 23, 2019 Share Posted January 23, 2019 2 hours ago, Andres ZeroCross said: Yes,, You can try this 4859 version with modified StartupSound.c by @Slice for testing Clover_v2.4k_r4859.pkg.zip Link to comment Share on other sites More sharing options...
Andres ZeroCross Posted January 23, 2019 Share Posted January 23, 2019 39 minutes ago, Matgen84 said: You can try this 4859 version with modified StartupSound.c by @Slice for testing Clover_v2.4k_r4859.pkg.zip I edited those lines (Line 193), then rebuild ./makepkg. I can confirm,. it works. Sound testing in GUI CLOVER works too 1 Link to comment Share on other sites More sharing options...
Badruzeus Posted January 24, 2019 Share Posted January 24, 2019 AudioDxe is working fine with r4860, thanks @Slice Still, I'm just bit confuse; do we need to always clear NVRAM first for any "Startup sound output" option changes via GUI? preboot_r4860.zip Link to comment Share on other sites More sharing options...
Slice Posted January 24, 2019 Share Posted January 24, 2019 1 hour ago, Badruzeus said: AudioDxe is working fine with r4860, thanks @Slice Still, I'm just bit confuse; do we need to always clear NVRAM first for any "Startup sound output" option changes via GUI? preboot_r4860.zip I see no case to clean NVRAM. 1 Link to comment Share on other sites More sharing options...
Badruzeus Posted January 24, 2019 Share Posted January 24, 2019 1 minute ago, Slice said: I see no case to clean NVRAM. Ok, thank you. And I just realized that "F7" for Startup audio test; is working either. I believe it sounds like a guitar. Link to comment Share on other sites More sharing options...
tluck Posted January 24, 2019 Share Posted January 24, 2019 FYI: with r4861 now the sound chime works on my Dell 4800. cool. 1 Link to comment Share on other sites More sharing options...
SavageAUS Posted January 24, 2019 Share Posted January 24, 2019 Does not work on my X299 clone.....and I tried all of these options......using Clover 4861 Now, I added nothing else, no BootChime stuff, just selected the options and rebooted, each one. Do I need to do something special? Do I have to use a specific Theme? (because I just used my standard Buttons theme). My computer uses a Vega 64 and normally plays it's output on my HDMI, but for this test, I connected a speaker to my green port on the rear of my computer (which, in my computer is seen as internal speakers). I tested to make sure I got sound, and then went through the rebooting I described earlier. Three of the HDMI/AMD outputs locked up the computer entirely (only a power off or reset would restore control). I did use the SVG option, didn't make any difference..... You need to have the sound file (named sound.wav) in the theme folder that you are you using to hear the sound. The wav file also must be converted properly or you can copy and paste the one supplied in the Clovy folder to your current theme folder. Sent from my iPhone using Tapatalk Link to comment Share on other sites More sharing options...
STLVNUB Posted January 24, 2019 Share Posted January 24, 2019 (edited) I have sound when in GUI F7, but when booting Mojave, computer resets, need to delete AudioDxe.efi in order to boot, is there a missed bug somewhere? Edited January 24, 2019 by STLVNUB 1 Link to comment Share on other sites More sharing options...
SavageAUS Posted January 24, 2019 Share Posted January 24, 2019 Kext injection appears to be broken in macOS Mojave 10.14.4 beta. Sent from my iPhone using Tapatalk Link to comment Share on other sites More sharing options...
PMheart Posted January 24, 2019 Share Posted January 24, 2019 (edited) 4 hours ago, SavageAUS said: Kext injection appears to be broken in macOS Mojave 10.14.4 beta. Sent from my iPhone using Tapatalk No worries, I have fixed it up! EDIT: Please see https://www.insanelymac.com/forum/topic/284656-clover-general-discussion/?do=findComment&comment=2661179 for the final fix! Edited January 25, 2019 by PMheart 4 2 Link to comment Share on other sites More sharing options...
STLVNUB Posted January 24, 2019 Share Posted January 24, 2019 16 minutes ago, PMheart said: No worries, I have fixed it up! See https://www.insanelymac.com/forum/topic/337357-pre-release-macos-mojave-10144/?do=findComment&comment=2661150 for more detail. Your all heart PM 1 Link to comment Share on other sites More sharing options...
Tobiko Posted January 25, 2019 Share Posted January 25, 2019 3 hours ago, meaganmargaret said: So, that worked. I wish the sound it made was better. Comparing it to being played outside Clover and when Clover plays it at boot, well, there's a world of difference. The other thing that concerns me is no AMD on HDMI support........oh well, baby steps, I guess..... My laptop had issues playing the startup sound from a theme. It played but it was buzzy - nasally. I converted the sound.wav from 8000 to 48000 and now it sounds fine. You may want to try it. I used audacity. Link to comment Share on other sites More sharing options...
Andres ZeroCross Posted January 25, 2019 Share Posted January 25, 2019 In Mojave 10.14.4 Dev Beta 1. Clover fail to inject kext. PMHeart make modification of clover injection and can do that, please make a fix Sent from my Mi Note 2 using Tapatalk Link to comment Share on other sites More sharing options...
PMheart Posted January 25, 2019 Share Posted January 25, 2019 Hi again, I have cleaned up kext_inject.c once more. (See here) Now that a friend has confirmed that it did work, let me post the diff here. --- kext_inject_org.c 2019-01-25 10:20:46.000000000 +0800 +++ kext_inject_mod.c 2019-01-25 10:42:03.000000000 +0800 @@ -665,16 +665,30 @@ UINT8 KBEMojaSearchEXT[] = { 0xE8, 0xAF, 0x00, 0x00, 0x00, 0xEB, 0x05, 0xE8 }; UINT8 KBEMojaReplaceEXT[] = { 0xE8, 0xAF, 0x00, 0x00, 0x00, 0x90, 0x90, 0xE8 }; -// High Sierra/Mojave (SIP) -// PMheart: checked KBEHighSie*SIP +// High Sierra / Mojave 10.14 - 10.14.3 (SIP) +// PMheart: for 10.14.4+, see KBEMoja4SearchSIP and KBEMoja4ReplaceSIP below +// PMheart: checked KBEHighSieMoja3*SIP // Need to pair with KBEMoja*EXT -UINT8 KBEHighSieMojaSearchSIP[] = { 0xC3, 0x48, 0x85, 0xDB, 0x74, 0x69, 0x48, 0x8B, 0x03, 0x48, 0x89, 0xDF, 0xFF, 0x50, 0x28, 0x48 }; -UINT8 KBEHighSieMojaReplaceSIP[] = { 0xC3, 0x48, 0x85, 0xDB, 0xEB, 0x12, 0x48, 0x8B, 0x03, 0x48, 0x89, 0xDF, 0xFF, 0x50, 0x28, 0x48 }; +UINT8 KBEHighSieMoja3SearchSIP[] = { 0xC3, 0x48, 0x85, 0xDB, 0x74, 0x69, 0x48, 0x8B, 0x03, 0x48, 0x89, 0xDF, 0xFF, 0x50, 0x28, 0x48 }; +UINT8 KBEHighSieMoja3ReplaceSIP[] = { 0xC3, 0x48, 0x85, 0xDB, 0xEB, 0x12, 0x48, 0x8B, 0x03, 0x48, 0x89, 0xDF, 0xFF, 0x50, 0x28, 0x48 }; +// Mojave 10.14.4+ (SIP) +// PMheart: checked KBEMoja4*SIP +// Need to pair with KBEMoja*EXT +UINT8 KBEMoja4SearchSIP[] = { 0x48, 0x85, 0xC0, 0x74, 0x6C, 0x48, 0x89, 0xC3, 0x48, 0x8B, 0x00, 0x48, 0x89, 0xDF, 0xFF, 0x50, 0x28, 0x48 }; +UINT8 KBEMoja4ReplaceSIP[] = { 0x48, 0x85, 0xC0, 0xEB, 0x15, 0x48, 0x89, 0xC3, 0x48, 0x8B, 0x00, 0x48, 0x89, 0xDF, 0xFF, 0x50, 0x28, 0x48 }; + +// Mojave 10.14 - 10.14.3 // Avoid race condition in OSKext::removeKextBootstrap when using booter kexts without keepsyms=1. -UINT8 KBEMojaSearchKxldUnmap[] = { 0x00, 0x0F, 0x85, 0xB2, 0x01, 0x00, 0x00, 0x48 }; -UINT8 KBEMojaReplaceKxldUnmap[] = { 0x00, 0x90, 0xE9, 0xB2, 0x01, 0x00, 0x00, 0x48 }; +// by vit9696 +UINT8 KBEMoja3SearchKxldUnmap[] = { 0x00, 0x0F, 0x85, 0xB2, 0x01, 0x00, 0x00, 0x48 }; +UINT8 KBEMoja3ReplaceKxldUnmap[] = { 0x00, 0x90, 0xE9, 0xB2, 0x01, 0x00, 0x00, 0x48 }; +// Mojave 10.14.4+ +// Avoid race condition in OSKext::removeKextBootstrap when using booter kexts without keepsyms=1. +// by PMheart, based on vit9696's work +UINT8 KBEMoja4SearchKxldUnmap[] = { 0x00, 0x0F, 0x85, 0xB1, 0x01, 0x00, 0x00, 0x48 }; +UINT8 KBEMoja4ReplaceKxldUnmap[] = { 0x00, 0x90, 0xE9, 0xB1, 0x01, 0x00, 0x00, 0x48 }; // // We can not rely on OSVersion global variable for OS version detection, @@ -689,100 +703,114 @@ VOID EFIAPI KernelBooterExtensionsPatch(IN UINT8 *Kernel, LOADER_ENTRY *Entry) { UINTN Num = 0; - UINTN NumSnow_i386 = 0; - UINTN NumSnow_X64 = 0; - UINTN NumLion_i386 = 0; - UINTN NumLion_X64 = 0; - UINTN NumMLMav = 0; - UINTN NumMLDebug = 0; - UINTN NumYos = 0; - UINTN NumMavYosDebug = 0; - UINTN NumEC = 0; - UINTN NumECDebug = 0; - UINTN NumSie = 0; - UINTN NumSieDebug = 0; - UINTN NumHighSieMoja = 0; - UINTN NumMoja = 0; + UINTN NumSnow_i386_EXT = 0; + UINTN NumSnow_X64_EXT = 0; + UINTN NumLion_i386_EXT = 0; + UINTN NumLion_X64_EXT = 0; + UINTN NumMLMavEXT = 0; + UINTN NumMLDebugEXT = 0; + UINTN NumYosEXT = 0; + UINTN NumMavYosDebugEXT = 0; + UINTN NumECSIP = 0; + UINTN NumECDebugSIP = 0; + UINTN NumSieSIP = 0; + UINTN NumSieDebugSIP = 0; + UINTN NumHighSieMoja3SIP = 0; // 10.13.X - 10.14.3 + UINTN NumMojaEXT = 0; // 10.14.X + UINTN NumMoja4SIP = 0; // 10.14.4+ DBG_RT(Entry, "\nPatching kernel for injected kexts...\n"); if (is64BitKernel) { - NumSnow_X64 = SearchAndCount(Kernel, KERNEL_MAX_SIZE, KBESnowSearchEXT_X64, sizeof(KBESnowSearchEXT_X64)); - NumLion_X64 = SearchAndCount(Kernel, KERNEL_MAX_SIZE, KBELionSearchEXT_X64, sizeof(KBELionSearchEXT_X64)); - NumMLMav = SearchAndCount(Kernel, KERNEL_MAX_SIZE, KBEMLMavSearchEXT, sizeof(KBEMLMavSearchEXT)); - //NumMLDebug = SearchAndCount(Kernel, KERNEL_MAX_SIZE, KBEMLDebugSearchEXT, sizeof(KBEMLDebugSearchEXT)); - NumYos = SearchAndCount(Kernel, KERNEL_MAX_SIZE, KBEYosECSieHighSearchEXT, sizeof(KBEYosECSieHighSearchEXT)); - //NumMavYosDebug = SearchAndCount(Kernel, KERNEL_MAX_SIZE, KBEMavYosDebugSearchEXT, sizeof(KBEMavYosDebugSearchEXT)); - NumEC = SearchAndCount(Kernel, KERNEL_MAX_SIZE, KBEECSearchSIP, sizeof(KBEECSearchSIP)); - //NumECDebug = SearchAndCount(Kernel, KERNEL_MAX_SIZE, KBEECDebugSearchSIP, sizeof(KBEECDebugSearchSIP)); - NumSie = SearchAndCount(Kernel, KERNEL_MAX_SIZE, KBESieSearchSIP, sizeof(KBESieSearchSIP)); - NumSieDebug = SearchAndCount(Kernel, KERNEL_MAX_SIZE, KBESieDebugSearchSIP, sizeof(KBESieDebugSearchSIP)); - NumHighSieMoja = SearchAndCount(Kernel, KERNEL_MAX_SIZE, KBEHighSieMojaSearchSIP, sizeof(KBEHighSieMojaSearchSIP)); - NumMoja = SearchAndCount(Kernel, KERNEL_MAX_SIZE, KBEMojaSearchEXT, sizeof(KBEMojaSearchEXT)); - } - else { - NumSnow_i386 = SearchAndCount(Kernel, KERNEL_MAX_SIZE, KBESnowSearchEXT_i386, sizeof(KBESnowSearchEXT_i386)); - NumLion_i386 = SearchAndCount(Kernel, KERNEL_MAX_SIZE, KBELionSearchEXT_i386, sizeof(KBELionSearchEXT_i386)); + NumSnow_X64_EXT = SearchAndCount(Kernel, KERNEL_MAX_SIZE, KBESnowSearchEXT_X64, sizeof(KBESnowSearchEXT_X64)); + NumLion_X64_EXT = SearchAndCount(Kernel, KERNEL_MAX_SIZE, KBELionSearchEXT_X64, sizeof(KBELionSearchEXT_X64)); + NumMLMavEXT = SearchAndCount(Kernel, KERNEL_MAX_SIZE, KBEMLMavSearchEXT, sizeof(KBEMLMavSearchEXT)); + //NumMLDebugEXT = SearchAndCount(Kernel, KERNEL_MAX_SIZE, KBEMLDebugSearchEXT, sizeof(KBEMLDebugSearchEXT)); + NumYosEXT = SearchAndCount(Kernel, KERNEL_MAX_SIZE, KBEYosECSieHighSearchEXT, sizeof(KBEYosECSieHighSearchEXT)); + //NumMavYosDebugEXT = SearchAndCount(Kernel, KERNEL_MAX_SIZE, KBEMavYosDebugSearchEXT, sizeof(KBEMavYosDebugSearchEXT)); + NumECSIP = SearchAndCount(Kernel, KERNEL_MAX_SIZE, KBEECSearchSIP, sizeof(KBEECSearchSIP)); + //NumECDebugSIP = SearchAndCount(Kernel, KERNEL_MAX_SIZE, KBEECDebugSearchSIP, sizeof(KBEECDebugSearchSIP)); + NumSieSIP = SearchAndCount(Kernel, KERNEL_MAX_SIZE, KBESieSearchSIP, sizeof(KBESieSearchSIP)); + NumSieDebugSIP = SearchAndCount(Kernel, KERNEL_MAX_SIZE, KBESieDebugSearchSIP, sizeof(KBESieDebugSearchSIP)); + NumHighSieMoja3SIP = SearchAndCount(Kernel, KERNEL_MAX_SIZE, KBEHighSieMoja3SearchSIP, sizeof(KBEHighSieMoja3SearchSIP)); + NumMojaEXT = SearchAndCount(Kernel, KERNEL_MAX_SIZE, KBEMojaSearchEXT, sizeof(KBEMojaSearchEXT)); // general EXT patch, for all 10.14.x + NumMoja4SIP = SearchAndCount(Kernel, KERNEL_MAX_SIZE, KBEMoja4SearchSIP, sizeof(KBEMoja4SearchSIP)); // SIP patch, ONLY for 10.14.4+ + } else { + NumSnow_i386_EXT = SearchAndCount(Kernel, KERNEL_MAX_SIZE, KBESnowSearchEXT_i386, sizeof(KBESnowSearchEXT_i386)); + NumLion_i386_EXT = SearchAndCount(Kernel, KERNEL_MAX_SIZE, KBELionSearchEXT_i386, sizeof(KBELionSearchEXT_i386)); } - if (NumSnow_i386 + NumSnow_X64 + NumLion_i386 + NumLion_X64 + NumMLMav > 1) { + if (NumSnow_i386_EXT + NumSnow_X64_EXT + NumLion_i386_EXT + NumLion_X64_EXT + NumMLMavEXT > 1) { // more then one pattern found - we do not know what to do with it // and we'll skipp it - AsciiPrint("\nERROR patching kernel for injected kexts:\nmultiple patterns found (Snowi386: %d, SnowX64: %d, Lioni386: %d, LionX64: %d, MLMav: %d) - skipping patching!\n", NumSnow_i386, NumSnow_X64, NumLion_i386, NumLion_X64, NumMLMav); + AsciiPrint("\nERROR patching kernel for injected kexts:\nmultiple patterns found (Snowi386: %d, SnowX64: %d, Lioni386: %d, LionX64: %d, MLMav: %d) - skipping patching!\n", NumSnow_i386_EXT, NumSnow_X64_EXT, NumLion_i386_EXT, NumLion_X64_EXT, NumMLMavEXT); gBS->Stall(10000000); return; } // X64 - if (NumMoja == 1) { - Num = SearchAndReplace(Kernel, KERNEL_MAX_SIZE, KBEMojaSearchEXT, sizeof(KBEMojaSearchEXT), KBEMojaReplaceEXT, 1) + - SearchAndReplace(Kernel, KERNEL_MAX_SIZE, KBEHighSieMojaSearchSIP, sizeof(KBEHighSieMojaSearchSIP), KBEHighSieMojaReplaceSIP, 1) + - SearchAndReplace(Kernel, KERNEL_MAX_SIZE, KBEMojaSearchKxldUnmap, sizeof(KBEMojaSearchKxldUnmap), KBEMojaReplaceKxldUnmap, 1); - DBG_RT(Entry, "==> kernel Mojave: %d replaces done.\n", Num); - } else if (NumHighSieMoja == 1) { + if (NumMojaEXT == 1) { + // apply EXT patch first + Num = SearchAndReplace(Kernel, KERNEL_MAX_SIZE, KBEMojaSearchEXT, sizeof(KBEMojaSearchEXT), KBEMojaReplaceEXT, 1); + // then apply corresponding patches based on what we found + if (NumMoja4SIP == 1) { + // firstly, try to patch 10.14.4+ + Num += SearchAndReplace(Kernel, KERNEL_MAX_SIZE, KBEMoja4SearchSIP, sizeof(KBEMoja4SearchSIP), KBEMoja4ReplaceSIP, 1) + + SearchAndReplace(Kernel, KERNEL_MAX_SIZE, KBEMoja4SearchKxldUnmap, sizeof(KBEMoja4SearchKxldUnmap), KBEMoja4ReplaceKxldUnmap, 1); + DBG_RT(Entry, "==> kernel Mojave (10.14.4+): %d replaces done.\n", Num); + } else if (NumHighSieMoja3SIP == 1) { + // then 10.14 - 10.14.3 + Num += SearchAndReplace(Kernel, KERNEL_MAX_SIZE, KBEHighSieMoja3SearchSIP, sizeof(KBEHighSieMoja3SearchSIP), KBEHighSieMoja3ReplaceSIP, 1) + + SearchAndReplace(Kernel, KERNEL_MAX_SIZE, KBEMoja3SearchKxldUnmap, sizeof(KBEMoja3SearchKxldUnmap), KBEMoja3ReplaceKxldUnmap, 1); + DBG_RT(Entry, "==> kernel Mojave (10.14 - 10.14.3): %d replaces done.\n", Num); + } else { + // no SIP and KxldUnmap pattern found! + DBG_RT(Entry, "==> kernel Mojave WARNING: pattern NOT found - only %d replaces done.\nKext Injection will NOT work!\n", Num); + } + } else if (NumHighSieMoja3SIP == 1) { Num = SearchAndReplace(Kernel, KERNEL_MAX_SIZE, KBEYosECSieHighSearchEXT, sizeof(KBEYosECSieHighSearchEXT), KBEYosECSieHighReplaceEXT, 1) + - SearchAndReplace(Kernel, KERNEL_MAX_SIZE, KBEHighSieMojaSearchSIP, sizeof(KBEHighSieMojaSearchSIP), KBEHighSieMojaReplaceSIP, 1); + SearchAndReplace(Kernel, KERNEL_MAX_SIZE, KBEHighSieMoja3SearchSIP, sizeof(KBEHighSieMoja3SearchSIP), KBEHighSieMoja3ReplaceSIP, 1); DBG_RT(Entry, "==> kernel High Sierra: %d replaces done.\n", Num); - } else if (NumSieDebug == 1) { + } else if (NumSieDebugSIP == 1) { Num = SearchAndReplace(Kernel, KERNEL_MAX_SIZE, KBESieDebugSearchEXT, sizeof(KBESieDebugSearchEXT), KBESieDebugReplaceEXT, 1) + SearchAndReplace(Kernel, KERNEL_MAX_SIZE, KBESieDebugSearchSIP, sizeof(KBESieDebugSearchSIP), KBESieDebugReplaceSIP, 1); DBG_RT(Entry, "==> kernel Sierra Debug: %d replaces done.\n", Num); - } else if (NumSie == 1) { + } else if (NumSieSIP == 1) { Num = SearchAndReplace(Kernel, KERNEL_MAX_SIZE, KBEYosECSieHighSearchEXT, sizeof(KBEYosECSieHighSearchEXT), KBEYosECSieHighReplaceEXT, 1) + SearchAndReplace(Kernel, KERNEL_MAX_SIZE, KBESieSearchSIP, sizeof(KBESieSearchSIP), KBESieReplaceSIP, 1); DBG_RT(Entry, "==> kernel Sierra: %d replaces done.\n", Num); - } else if (NumECDebug == 1) { + } else if (NumECDebugSIP == 1) { Num = SearchAndReplace(Kernel, KERNEL_MAX_SIZE, KBEECDebugSearchEXT, sizeof(KBEECDebugSearchEXT), KBEECDebugReplaceEXT, 1) + SearchAndReplace(Kernel, KERNEL_MAX_SIZE, KBEECDebugSearchSIP, sizeof(KBEECDebugSearchSIP), KBEECDebugReplaceSIP, 1); DBG_RT(Entry, "==> kernel El Capitan Debug: %d replaces done.\n", Num); - } else if (NumEC == 1) { + } else if (NumECSIP == 1) { Num = SearchAndReplace(Kernel, KERNEL_MAX_SIZE, KBEYosECSieHighSearchEXT, sizeof(KBEYosECSieHighSearchEXT), KBEYosECSieHighReplaceEXT, 1) + SearchAndReplace(Kernel, KERNEL_MAX_SIZE, KBEECSearchSIP, sizeof(KBEECSearchSIP), KBEECReplaceSIP, 1); DBG_RT(Entry, "==> kernel El Capitan: %d replaces done.\n", Num); - } else if (NumMavYosDebug == 1) { + } else if (NumMavYosDebugEXT == 1) { Num = SearchAndReplace(Kernel, KERNEL_MAX_SIZE, KBEMavYosDebugSearchEXT, sizeof(KBEMavYosDebugReplaceEXT), KBEMavYosDebugReplaceEXT, 1); DBG_RT(Entry, "==> kernel Yosemite Debug: %d replaces done.\n", Num); - } else if (NumYos == 1) { + } else if (NumYosEXT == 1) { Num = SearchAndReplace(Kernel, KERNEL_MAX_SIZE, KBEYosECSieHighSearchEXT, sizeof(KBEYosECSieHighSearchEXT), KBEYosECSieHighReplaceEXT, 1); DBG_RT(Entry, "==> kernel Yosemite: %d replaces done.\n", Num); - } else if (NumMLDebug == 1) { + } else if (NumMLDebugEXT == 1) { Num = SearchAndReplace(Kernel, KERNEL_MAX_SIZE, KBEMLDebugSearchEXT, sizeof(KBEMLDebugSearchEXT), KBEMLDebugReplaceEXT, 1); DBG_RT(Entry, "==> kernel Mountain Lion Debug: %d replaces done.\n", Num) - } else if (NumMLMav == 1) { + } else if (NumMLMavEXT == 1) { Num = SearchAndReplace(Kernel, KERNEL_MAX_SIZE, KBEMLMavSearchEXT, sizeof(KBEMLMavSearchEXT), KBEMLMavReplaceEXT, 1); DBG_RT(Entry, "==> kernel Mountain Lion/Mavericks: %d replaces done.\n", Num); - } else if (NumLion_X64 == 1) { + } else if (NumLion_X64_EXT == 1) { Num = SearchAndReplace(Kernel, KERNEL_MAX_SIZE, KBELionSearchEXT_X64, sizeof(KBELionSearchEXT_X64), KBELionReplaceEXT_X64, 1); DBG_RT(Entry, "==> kernel Lion X64: %d replaces done.\n", Num); - } else if (NumSnow_X64 == 1) { + } else if (NumSnow_X64_EXT == 1) { Num = SearchAndReplace(Kernel, KERNEL_MAX_SIZE, KBESnowSearchEXT_X64, sizeof(KBESnowSearchEXT_X64), KBESnowReplaceEXT_X64, 1); DBG_RT(Entry, "==> kernel Snow Leopard X64: %d replaces done.\n", Num); // i386 - } else if (NumLion_i386 == 1) { + } else if (NumLion_i386_EXT == 1) { Num = SearchAndReplace(Kernel, KERNEL_MAX_SIZE, KBELionSearchEXT_i386, sizeof(KBELionSearchEXT_i386), KBELionReplaceEXT_i386, 1); DBG_RT(Entry, "==> kernel Lion i386: %d replaces done.\n", Num); - } else if (NumSnow_i386 == 1) { + } else if (NumSnow_i386_EXT == 1) { Num = SearchAndReplace(Kernel, KERNEL_MAX_SIZE, KBESnowSearchEXT_i386, sizeof(KBESnowSearchEXT_i386), KBESnowReplaceEXT_i386, 1); DBG_RT(Entry, "==> kernel Snow Leopard i386: %d replaces done.\n", Num); } else { Here is the full kext_inject.c, if needed. cleanup_kext_inject.zip Thanks! 2 2 Link to comment Share on other sites More sharing options...
Recommended Posts