Jump to content

Clover General discussion


ErmaC
29,818 posts in this topic

Recommended Posts

20 hours ago, Matgen84 said:

Hi

 

Compile Clover under Catalina/ Xcode 11:) succeded (UDK script 2018). I can compile too after modify from Build_Clover.command :thumbsup_anim: 

 

 

But without revision  number. into both case. See below

 

Capture d’écran 2019-06-21 à 11.54.12.png

 

Hi again

 

revision number missing after compilation (Catalina Beta 2 / Xcode 11 Beta). 

 

Any idea, why

  • Thanks 1
Link to comment
Share on other sites

1 hour ago, Matgen84 said:

Hi again

revision number missing after compilation (Catalina Beta 2 / Xcode 11 Beta). 

Any idea, why

If I still remember, macOS Catalina now uses ZSH by default. Try using Bash as your Terminal's Shell instead of ZSH, relaunch Terminal then rebuild Clover.

Changing Your Default Shell From Terminal
Open Terminal and enter the following command:

$ chsh -s path
Where path is one of shell paths listed in /etc/shells, such as /bin/zsh, /bin/bash, /bin/csh, /bin/dash, /bin/ksh, /bin/sh, or /bin/tcsh.

#EDIT: Also consider doing this :

cd ~/src/UDK2018
rm -rf Build
make -C BaseTools/Source/C

 

Edited by Badruzeus
  • Thanks 2
Link to comment
Share on other sites

1 hour ago, Matgen84 said:

 

Hi again

 

revision number missing after compilation (Catalina Beta 2 / Xcode 11 Beta). 

 

Any idea, why

 

I also noticed the missing revision number when making the Clover Package with the makepkg script in Catalina (Xcode 10.2.1).  The build log throws the error below ...

 

fusion71au@fusion71aus-Mac-Pro Clover % cd CloverPackage
fusion71au@fusion71aus-Mac-Pro CloverPackage % ./makepkg
./makepkg: line 38: svnversion: command not found

 

Spoiler

 

543099151_makepkgfromCloverPackage.png.c8b064b70072e6871d18bf2e1b4c3686.png

 

15159788_makepkgerror.thumb.png.40560189c8e280f66fe7239401340d6d.png

 

 

 

Strangely enough, when I build Clover with the Build_Clover.command in Catalina, the Clover revision number is generated OK.  Also revision number ok with make iso...


 

Spoiler

 

Build_Clover.command.png.6103da0852e70a743cf7470c0bd54616.png

 

1045538319_makeisofromCloverPackage.png.54192bbc2ae11ad308b6968598fa0a68.png

 

 

  • Like 2
Link to comment
Share on other sites

8 minutes ago, fusion71au said:

 

I also noticed the missing revision number when making the Clover Package with the makepkg script in Catalina (Xcode 10.2.1).  The build log throws the error below ...

 


fusion71au@fusion71aus-Mac-Pro Clover % cd CloverPackage
fusion71au@fusion71aus-Mac-Pro CloverPackage % ./makepkg
./makepkg: line 38: svnversion: command not found

 

Are you using Bash? How if update to Subversion 1.12.0? Though, not really sure if the issue comes from SVN hmmmb..

Edited by Badruzeus
Link to comment
Share on other sites

19 minutes ago, Badruzeus said:

Are you using Bash? How if update to Subversion 1.12.0? Though, not really sure if the issue comes from SVN hmmmb..

No, everything stock standard in Catalina.

 

If I run svnversion command in Cat terminal ---> get "command not found" (but svn info works so maybe work around)

If I run svnversion command in High Sierra/Mojave terminal---> get correct Clover revision number (4968)

  • Like 2
  • Thanks 1
Link to comment
Share on other sites

32 minutes ago, fusion71au said:

 

I also noticed the missing revision number when making the Clover Package with the makepkg script in Catalina (Xcode 10.2.1).  The build log throws the error below ...

 


fusion71au@fusion71aus-Mac-Pro Clover % cd CloverPackage
fusion71au@fusion71aus-Mac-Pro CloverPackage % ./makepkg
./makepkg: line 38: svnversion: command not found

 

  Reveal hidden contents

 

543099151_makepkgfromCloverPackage.png.c8b064b70072e6871d18bf2e1b4c3686.png

 

15159788_makepkgerror.thumb.png.40560189c8e280f66fe7239401340d6d.png

 

 

 

Strangely enough, when I build Clover with the Build_Clover.command in Catalina, the Clover revision number is generated OK.  Also revision number ok with make iso...


 

  Reveal hidden contents

 

Build_Clover.command.png.6103da0852e70a743cf7470c0bd54616.png

 

1045538319_makeisofromCloverPackage.png.54192bbc2ae11ad308b6968598fa0a68.png

 

 

 

I don't try Xcode 10.2.1 in Catalina, only XCode 11. With Xcode 11 command lines tools installed, I haven't "./makepkg: line 38: subversion: command not found"

 

Strangely, using Build_Clover.command and Dis UDK2018 script,  the Clover revision number is not generated without error message.

 

 

Sorry about my bad english

Edited by Matgen84
Link to comment
Share on other sites

1 hour ago, cecekpawon said:

If 'svnversion' are gone in newest os, I think switching all 'svnversion' to 'svn info | grep "Revision" | tr -cd [:digit:]' cmd is the best option.

 

I just replaced line 38 in makepkg file (located in ~/src/edk2/Clover/CloverPackage folder)

 

revision=$(svnversion -n | tr -d [:alpha:])

 

with

 

revision=$(cat ../vers.txt)

 

referring to vers.txt file in /Clover folder (like makeiso script does) and it works!

 

553670380_makepkgmodified.png.e923994acc56ddd88a475625af080fb6.png

 

The command svn info | grep Revision | tr -cd [:digit:] unfortunately returns no matches found...

fusion71au@fusion71aus-Mac-Pro CloverPackage % svn info | grep Revision | tr -cd [:digit:]             
zsh: no matches found: [:digit:]

 

 

1 hour ago, Matgen84 said:

Strangely, using Build_Clover.command and Dis UDK2018 script,  the Clover revision number is not generated without error message.

 

@Matgen84,

 

1.  Open the vers.txt file in your ~/src/edk2/Clover folder (after building Clover) and confirm it says the correct version eg 4968.

 

2.  Replace ~/src/edk2/Clover/CloverPackage/makepkg file with attached: makepkg.zip

 

3.  Open terminal and type
 

cd ~/src/edk2/Clover/CloverPackage

./makepkg

 

Edited by fusion71au
Extra for @Matgen84
  • Thanks 1
Link to comment
Share on other sites

2 hours ago, fusion71au said:

 

I just replaced line 38 in makepkg file (located in ~/src/edk2/Clover/CloverPackage folder)

 

revision=$(svnversion -n | tr -d [:alpha:])

 

with

 

revision=$(cat ../vers.txt)

 

referring to vers.txt file in /Clover folder (like makeiso script does) and it works!

 

553670380_makepkgmodified.png.e923994acc56ddd88a475625af080fb6.png

 

The command svn info | grep Revision | tr -cd [:digit:] unfortunately returns no matches found...


fusion71au@fusion71aus-Mac-Pro CloverPackage % svn info | grep Revision | tr -cd [:digit:]             
zsh: no matches found: [:digit:]

 

 

 

@Matgen84,

 

1.  Open the vers.txt file in your ~/src/edk2/Clover folder (after building Clover) and confirm it says the correct version eg 4968.

 

2.  Replace ~/src/edk2/Clover/CloverPackage/makepkg file with attached: makepkg.zip

 

3.  Open terminal and type
 


cd ~/src/edk2/Clover/CloverPackage

./makepkg

 

 

All works fine. Thanks :thumbsup_anim: Do you know a solution for Clover Logo missing in Dark Mode

  • Like 1
Link to comment
Share on other sites

hi everyone

i want to test all mac os boot.

i tested

10.13

10.14

10.15

 

if you have lower macos, please report all.

since 10.6~10.12. it will be help for clover with future.

 

no need to install macos. just make usb installer and test get installation windows

 

thanks in advance

injection test.zip

  • Like 1
Link to comment
Share on other sites

13 hours ago, Sherlocks said:

hi everyone

i want to test all mac os boot.

i tested

10.13

10.14

10.15

 

if you have lower macos, please report all.

since 10.6~10.12. it will be help for clover with future.

 

no need to install macos. just make usb installer and test get installation windows

 

thanks in advance

injection test.zip

The lapic patch works at my first attempt with Catalina just some minutes ago (compiled the latest from sf). What is no longer working is the ivy-bridge xcpm patch, had to use AICPM.

  • Like 1
Link to comment
Share on other sites

14 hours ago, Sherlocks said:

hi everyone

i want to test all mac os boot.

i tested

10.13

10.14

10.15

 

if you have lower macos, please report all.

since 10.6~10.12. it will be help for clover with future.

 

no need to install macos. just make usb installer and test get installation windows

 

thanks in advance

injection test.zip

@Sherlocks

Hi, I tested the boot on 10.7, 10.8, 10.9 10.10, 10.11, 10.12

and the booting of it worked perfectly.

Except on 10.7 it boots only in legacy mode, but not in uefi mode, but it has always been like that with my System, maybe it's my setup or my hardware.

As a note: I had just booted the installer, had not installed the os versions on hdd/ssd.

I had additionally tested the os versions that I had already installed:

It was 10.13, 10.14, 10.15, they also booted perfectly, but you had already tested that.

And as second note: I used the files from your uploaded zip to test it: injection test.zip.

Couldn't test the version 10.6 because my processor is not compatible with it (Ivy Bridge) and maybe also my Graphic Card (GTX 680)

btw. If the Config file or the Drivers is also important for that test, I can send you the files I used over PM

Edited by tahsinahmed
  • Like 1
Link to comment
Share on other sites

4 hours ago, vector sigma said:

The lapic patch works at my first attempt with Catalina just some minutes ago (compiled the latest from sf). What is no longer working is the ivy-bridge xcpm patch, had to use AICPM.

 

hi vector. strange. what is your ivy bridge patch?

Link to comment
Share on other sites

3 hours ago, tahsinahmed said:

@Sherlocks

Hi, I tested the boot on 10.7, 10.8, 10.9 10.10, 10.11, 10.12

and the booting of it worked perfectly.

Except on 10.7 it boots only in legacy mode, but not in uefi mode, but it has always been like that with my System, maybe it's my setup or my hardware.

As a note: I had just booted the installer, had not installed the os versions on hdd/ssd.

I had additionally tested the os versions that I had already installed:

It was 10.13, 10.14, 10.15, they also booted perfectly, but you had already tested that.

And as second note: I used the files from your uploaded zip to test it: injection test.zip.

Couldn't test the version 10.6 because my processor is not compatible with it (Ivy Bridge) and maybe also my Graphic Card (GTX 680)

btw. If the Config file or the Drivers is also important for that test, I can send you the files I used over PM

 

thanks a lot

10.6 and 10.7 are same like before.

no problems to boot 10.6 and 10.7.

because pattern is not good to define.

so i remained 10.6/10.7

  • Like 1
Link to comment
Share on other sites

6 hours ago, Matgen84 said:

Hi @Sherlocks and Clover Team,

 

Is it possible to display Clover Logo from Background (package/resources) in Dark Mode? Only Light Mode is correct actually. 

It looks like the problem is macOS DarkMode; not Clover package. Also occurred with another packages as well.

Edited by Badruzeus
  • Like 2
Link to comment
Share on other sites

23 minutes ago, Badruzeus said:

It looks like the problem is macOS DarkMode; not Clover package. Also occurred with another packages as well.

It's clearly a bug, already solved in Xcode 10 last year. Not sure we need a solution, which I eventually have (I have a tiny command line for that in the hwsensor project), or just wait for a better Xcode 11 that will fix the bug as already was with predecessor. Anyway I din't try it my self as I installed Catalina only few hours ago, but I will soon.

  • Thanks 2
Link to comment
Share on other sites

1 hour ago, Sherlocks said:

hi vector. strange. what is your ivy bridge patch?

To be clear I've already checked the kernel and the below code seems to at least patch all occurrences as it is programmed for:

BOOLEAN KernelIvyBridgeXCPM(VOID *kernelData, LOADER_ENTRY *Entry, BOOLEAN use_xcpm_idle)
{
  UINT8       *kern = (UINT8*)kernelData;
  CHAR8       *comment;
  UINT32      i;
  UINT32      patchLocation;
  UINT64      os_version = AsciiOSVersionToUint64(Entry->OSVersion);

  // check whether Ivy Bridge
  if (gCPUStructure.Model != CPU_MODEL_IVY_BRIDGE) {
    DBG("Unsupported platform.\nRequires Ivy Bridge, aborted\n");
    DBG("KernelIvyBridgeXCPM() <===FALSE\n");
    return FALSE;
  }

  // check OS version suit for patches
  // PMheart: attempt to add 10.14 compatibility
  if (os_version < AsciiOSVersionToUint64("10.8.5") || os_version >= AsciiOSVersionToUint64("10.15")) {
    DBG("Unsupported macOS.\nIvy Bridge XCPM requires macOS 10.8.5 - 10.13.x, aborted\n");
    DBG("KernelIvyBridgeXCPM() <===FALSE\n");
    return FALSE;
  } else if (os_version >= AsciiOSVersionToUint64("10.8.5") && os_version < AsciiOSVersionToUint64("10.12")) {
    // 10.8.5 - 10.11.x no need the following kernel patches on Ivy Bridge - we just use -xcpm boot-args
    DBG("KernelIvyBridgeXCPM() <===\n");
    return TRUE;
  }

  DBG("Searching _xcpm_pkg_scope_msr ...\n");
  if (os_version >= AsciiOSVersionToUint64("10.12")) {
    // 10.12+
    patchLocation = 0; // clean out the value just in case
    for (i = 0; i < 0x1000000; i++) {
      if (kern[i+0] == 0xBE && kern[i+1] == 0x07 && kern[i+2] == 0x00 && kern[i+3] == 0x00 &&
          kern[i+4] == 0x00 && kern[i+5] == 0x31 && kern[i+6] == 0xD2 && kern[i+7] == 0xE8) {
        patchLocation = i+7;
        DBG("Found _xcpm_pkg_scope_msr\n");
        break;
      }
    }

    if (patchLocation) {
      for (i = 0; i < 5; i++) {
        kern[patchLocation+i] = 0x90;
      }
      DBG("Applied _xcpm_pkg_scope_msr patch\n");
    } else {
      DBG("_xcpm_pkg_scope_msr not found, patch aborted\n");
      DBG("KernelIvyBridgeXCPM() <===FALSE\n");
      return FALSE;
    }
  }

  comment = "_xcpm_bootstrap";
  if (os_version <= AsciiOSVersionToUint64("10.12.5")) {
    // 10.12 - 10.12.5
    STATIC UINT8 find[] = { 0x83, 0xC3, 0xC4, 0x83, 0xFB, 0x22 };
    STATIC UINT8 repl[] = { 0x83, 0xC3, 0xC6, 0x83, 0xFB, 0x22 };
    applyKernPatch(kern, find, sizeof(find), repl, comment);
  } else if (os_version < AsciiOSVersionToUint64("10.13")) {
    // 10.12.6
    STATIC UINT8 find[] = { 0x8D, 0x43, 0xC4, 0x83, 0xF8, 0x22 };
    STATIC UINT8 repl[] = { 0x8D, 0x43, 0xC6, 0x83, 0xF8, 0x22 };
    applyKernPatch(kern, find, sizeof(find), repl, comment);
    // PMheart: attempt to add 10.14 compatibility
  } else if (os_version < AsciiOSVersionToUint64("10.15")) {
    // 10.13/10.14
    STATIC UINT8 find[] = { 0x89, 0xD8, 0x04, 0xC4, 0x3C, 0x22 };
    STATIC UINT8 repl[] = { 0x89, 0xD8, 0x04, 0xC6, 0x3C, 0x22 };
    applyKernPatch(kern, find, sizeof(find), repl, comment);
    // PMheart: attempt to add 10.15 compatibility
  } else if (os_version < AsciiOSVersionToUint64("10.16")) {
    STATIC UINT8 find[] = { 0x8D, 0x43, 0xC4, 0x3C, 0x22 };
    STATIC UINT8 repl[] = { 0x8D, 0x43, 0xC6, 0x3C, 0x22 };
    applyKernPatch(kern, find, sizeof(find), repl, comment);
  }

uless my cpu isn't involved, but should since is it a Core i5 3210M if I correctly understood the code.

  • Like 1
Link to comment
Share on other sites

5 minutes ago, vector sigma said:

To be clear I've already checked the kernel and the below code seems to at least patch all occurrences as it is programmed for:


BOOLEAN KernelIvyBridgeXCPM(VOID *kernelData, LOADER_ENTRY *Entry, BOOLEAN use_xcpm_idle)
{
  UINT8       *kern = (UINT8*)kernelData;
  CHAR8       *comment;
  UINT32      i;
  UINT32      patchLocation;
  UINT64      os_version = AsciiOSVersionToUint64(Entry->OSVersion);

  // check whether Ivy Bridge
  if (gCPUStructure.Model != CPU_MODEL_IVY_BRIDGE) {
    DBG("Unsupported platform.\nRequires Ivy Bridge, aborted\n");
    DBG("KernelIvyBridgeXCPM() <===FALSE\n");
    return FALSE;
  }

  // check OS version suit for patches
  // PMheart: attempt to add 10.14 compatibility
  if (os_version < AsciiOSVersionToUint64("10.8.5") || os_version >= AsciiOSVersionToUint64("10.15")) {
    DBG("Unsupported macOS.\nIvy Bridge XCPM requires macOS 10.8.5 - 10.13.x, aborted\n");
    DBG("KernelIvyBridgeXCPM() <===FALSE\n");
    return FALSE;
  } else if (os_version >= AsciiOSVersionToUint64("10.8.5") && os_version < AsciiOSVersionToUint64("10.12")) {
    // 10.8.5 - 10.11.x no need the following kernel patches on Ivy Bridge - we just use -xcpm boot-args
    DBG("KernelIvyBridgeXCPM() <===\n");
    return TRUE;
  }

  DBG("Searching _xcpm_pkg_scope_msr ...\n");
  if (os_version >= AsciiOSVersionToUint64("10.12")) {
    // 10.12+
    patchLocation = 0; // clean out the value just in case
    for (i = 0; i < 0x1000000; i++) {
      if (kern[i+0] == 0xBE && kern[i+1] == 0x07 && kern[i+2] == 0x00 && kern[i+3] == 0x00 &&
          kern[i+4] == 0x00 && kern[i+5] == 0x31 && kern[i+6] == 0xD2 && kern[i+7] == 0xE8) {
        patchLocation = i+7;
        DBG("Found _xcpm_pkg_scope_msr\n");
        break;
      }
    }

    if (patchLocation) {
      for (i = 0; i < 5; i++) {
        kern[patchLocation+i] = 0x90;
      }
      DBG("Applied _xcpm_pkg_scope_msr patch\n");
    } else {
      DBG("_xcpm_pkg_scope_msr not found, patch aborted\n");
      DBG("KernelIvyBridgeXCPM() <===FALSE\n");
      return FALSE;
    }
  }

  comment = "_xcpm_bootstrap";
  if (os_version <= AsciiOSVersionToUint64("10.12.5")) {
    // 10.12 - 10.12.5
    STATIC UINT8 find[] = { 0x83, 0xC3, 0xC4, 0x83, 0xFB, 0x22 };
    STATIC UINT8 repl[] = { 0x83, 0xC3, 0xC6, 0x83, 0xFB, 0x22 };
    applyKernPatch(kern, find, sizeof(find), repl, comment);
  } else if (os_version < AsciiOSVersionToUint64("10.13")) {
    // 10.12.6
    STATIC UINT8 find[] = { 0x8D, 0x43, 0xC4, 0x83, 0xF8, 0x22 };
    STATIC UINT8 repl[] = { 0x8D, 0x43, 0xC6, 0x83, 0xF8, 0x22 };
    applyKernPatch(kern, find, sizeof(find), repl, comment);
    // PMheart: attempt to add 10.14 compatibility
  } else if (os_version < AsciiOSVersionToUint64("10.15")) {
    // 10.13/10.14
    STATIC UINT8 find[] = { 0x89, 0xD8, 0x04, 0xC4, 0x3C, 0x22 };
    STATIC UINT8 repl[] = { 0x89, 0xD8, 0x04, 0xC6, 0x3C, 0x22 };
    applyKernPatch(kern, find, sizeof(find), repl, comment);
    // PMheart: attempt to add 10.15 compatibility
  } else if (os_version < AsciiOSVersionToUint64("10.16")) {
    STATIC UINT8 find[] = { 0x8D, 0x43, 0xC4, 0x3C, 0x22 };
    STATIC UINT8 repl[] = { 0x8D, 0x43, 0xC6, 0x3C, 0x22 };
    applyKernPatch(kern, find, sizeof(find), repl, comment);
  }

uless my cpu isn't involved, but should since is it a Core i5 3210M if I correctly understood the code.

 

right. seems to check kernelandkextpatch debug option and confirm patch is working

Link to comment
Share on other sites

Just now, Sherlocks said:

 

right. seems to check kernelandkextpatch debug option and confirm patch is working

I have to find a way to read the panic since it happens fast with a tedious kext's names logging that keeps all the screen without let me see the reason of the fault. But I suspect it's still regarding a locked msrs.. or at least it seems.

Link to comment
Share on other sites

2 hours ago, vector sigma said:

I have to find a way to read the panic since it happens fast with a tedious kext's names logging that keeps all the screen without let me see the reason of the fault. But I suspect it's still regarding a locked msrs.. or at least it seems.

serial or firewire kprintf?

  • Like 1
Link to comment
Share on other sites

3 hours ago, vector sigma said:

I have to find a way to read the panic since it happens fast with a tedious kext's names logging that keeps all the screen without let me see the reason of the fault. But I suspect it's still regarding a locked msrs.. or at least it seems.

@joevt is correct, and I hope we have a workaround to this: (Apply the patch via Clover KernelToPatch)

 

https://github.com/acidanthera/OcSupportPkg/blob/3223115d876632f13408f64c182046dc1badd785/Library/OcAppleKernelLib/CommonPatches.c#L948-L958

 

Credit to @vit9696.

  • Like 2
Link to comment
Share on other sites

5 hours ago, vector sigma said:

It's clearly a bug, already solved in Xcode 10 last year. Not sure we need a solution, which I eventually have (I have a tiny command line for that in the hwsensor project), or just wait for a better Xcode 11 that will fix the bug as already was with predecessor. Anyway I din't try it my self as I installed Catalina only few hours ago, but I will soon.

 

Right, not sure we need a solution. Missing Clover Logo occurs in Mojave/ Xcode 10 and Catalina/ Xcode 11 into my config. It's the same with release from Repo.

Link to comment
Share on other sites

9 hours ago, vector sigma said:

To be clear I've already checked the kernel and the below code seems to at least patch all occurrences as it is programmed for:


BOOLEAN KernelIvyBridgeXCPM(VOID *kernelData, LOADER_ENTRY *Entry, BOOLEAN use_xcpm_idle)
{
  UINT8       *kern = (UINT8*)kernelData;
  CHAR8       *comment;
  UINT32      i;
  UINT32      patchLocation;
  UINT64      os_version = AsciiOSVersionToUint64(Entry->OSVersion);

  // check whether Ivy Bridge
  if (gCPUStructure.Model != CPU_MODEL_IVY_BRIDGE) {
    DBG("Unsupported platform.\nRequires Ivy Bridge, aborted\n");
    DBG("KernelIvyBridgeXCPM() <===FALSE\n");
    return FALSE;
  }

  // check OS version suit for patches
  // PMheart: attempt to add 10.14 compatibility
  if (os_version < AsciiOSVersionToUint64("10.8.5") || os_version >= AsciiOSVersionToUint64("10.15")) {
    DBG("Unsupported macOS.\nIvy Bridge XCPM requires macOS 10.8.5 - 10.13.x, aborted\n");
    DBG("KernelIvyBridgeXCPM() <===FALSE\n");
    return FALSE;
  } else if (os_version >= AsciiOSVersionToUint64("10.8.5") && os_version < AsciiOSVersionToUint64("10.12")) {
    // 10.8.5 - 10.11.x no need the following kernel patches on Ivy Bridge - we just use -xcpm boot-args
    DBG("KernelIvyBridgeXCPM() <===\n");
    return TRUE;
  }

  DBG("Searching _xcpm_pkg_scope_msr ...\n");
  if (os_version >= AsciiOSVersionToUint64("10.12")) {
    // 10.12+
    patchLocation = 0; // clean out the value just in case
    for (i = 0; i < 0x1000000; i++) {
      if (kern[i+0] == 0xBE && kern[i+1] == 0x07 && kern[i+2] == 0x00 && kern[i+3] == 0x00 &&
          kern[i+4] == 0x00 && kern[i+5] == 0x31 && kern[i+6] == 0xD2 && kern[i+7] == 0xE8) {
        patchLocation = i+7;
        DBG("Found _xcpm_pkg_scope_msr\n");
        break;
      }
    }

    if (patchLocation) {
      for (i = 0; i < 5; i++) {
        kern[patchLocation+i] = 0x90;
      }
      DBG("Applied _xcpm_pkg_scope_msr patch\n");
    } else {
      DBG("_xcpm_pkg_scope_msr not found, patch aborted\n");
      DBG("KernelIvyBridgeXCPM() <===FALSE\n");
      return FALSE;
    }
  }

  comment = "_xcpm_bootstrap";
  if (os_version <= AsciiOSVersionToUint64("10.12.5")) {
    // 10.12 - 10.12.5
    STATIC UINT8 find[] = { 0x83, 0xC3, 0xC4, 0x83, 0xFB, 0x22 };
    STATIC UINT8 repl[] = { 0x83, 0xC3, 0xC6, 0x83, 0xFB, 0x22 };
    applyKernPatch(kern, find, sizeof(find), repl, comment);
  } else if (os_version < AsciiOSVersionToUint64("10.13")) {
    // 10.12.6
    STATIC UINT8 find[] = { 0x8D, 0x43, 0xC4, 0x83, 0xF8, 0x22 };
    STATIC UINT8 repl[] = { 0x8D, 0x43, 0xC6, 0x83, 0xF8, 0x22 };
    applyKernPatch(kern, find, sizeof(find), repl, comment);
    // PMheart: attempt to add 10.14 compatibility
  } else if (os_version < AsciiOSVersionToUint64("10.15")) {
    // 10.13/10.14
    STATIC UINT8 find[] = { 0x89, 0xD8, 0x04, 0xC4, 0x3C, 0x22 };
    STATIC UINT8 repl[] = { 0x89, 0xD8, 0x04, 0xC6, 0x3C, 0x22 };
    applyKernPatch(kern, find, sizeof(find), repl, comment);
    // PMheart: attempt to add 10.15 compatibility
  } else if (os_version < AsciiOSVersionToUint64("10.16")) {
    STATIC UINT8 find[] = { 0x8D, 0x43, 0xC4, 0x3C, 0x22 };
    STATIC UINT8 repl[] = { 0x8D, 0x43, 0xC6, 0x3C, 0x22 };
    applyKernPatch(kern, find, sizeof(find), repl, comment);
  }

uless my cpu isn't involved, but should since is it a Core i5 3210M if I correctly understood the code.

I didn't check in 10.14+ but it is working in 10.13 with my i5-3320M.

Link to comment
Share on other sites

×
×
  • Create New...