corna / me_cleaner

Tool for partial deblobbing of Intel ME/TXE firmware images
GNU General Public License v3.0
4.46k stars 277 forks source link

[HOW-TO] Apple Macs' EFI -- me_cleaner on Intel ME region #230

Open simonepsp opened 5 years ago

simonepsp commented 5 years ago

Since ME region deblobbing of Apple Macs has never been treated by this community I decided to write up a guide to help you with this process. Hope this will help users who are struggling with it. Unfortunately, this is untested but I'm quite confident it works (I'm waiting for the Matt Card to test it out).

But please, always do and store a backup of your EFI Rom.

1) Download or backup EFI firmware of your Mac. A) If you made rom backup by clipping the SOIC clip you're ready for step 2 B) Alternavely, you can download your MacOS' installation disk and extract EFI firmware from it. Firmware files are located in FirmwareUpgrade.pkg. -- Download your prefered Mac OS install dmg (eg. 10.14 Mojave from Mac Appstore) -- Mount InstallESD.dmg

eg. /usr/bin/hdiutil mount /Applications/Install\ macOS\ Mojave*.app/Contents/SharedSupport/InstallESD.dmg

-- Extract FirmwareUpdate.pkg with pkgutil: /usr/sbin/pkgutil --expand /Volumes/InstallESD/Packages/FirmwareUpdate.pkg /tmp/FirmwareUpdate -- Now look for the relevant EFI firmware in output folder (Scripts/Tools/EFIPayloads)

screenshot 2018-09-26 at 16 48 19

My MacBook Pro 14.2 (2017 model /w touchbar) has a boot rom version MBP142.0178.B00. I'm gonna use the same build.

screenshot 2018-09-26 at 17 11 02

2) By using UEFI Tool, open the EFI firmware .fd/.scap file and extract ME region ( https://github.com/LongSoft/UEFITool ). You can find the mac binary in "releases"

screenshot 2018-09-26 at 16 59 18

3) Deblob it with me_cleaner python me_cleaner.py me_region.bin -O me_output_deblob.bin

4) Replace me region with me_cleaner output by right-clicking on ME_REGION and then 'Replace as is' screenshot 2018-09-26 at 16 58 38

5) Save image (File >> Save Image File)

6) Flash the EFI firmware with a Raspberry PI and a SOIC 8 clip. You might even buy a Matt Card instead of flashing the soldered rom http://www.cmizapper.com/buy/mattcard-macbook-pro.html

7) PROFIT ??!

mouezby commented 4 years ago

You re a doctor 😷 Thank you

silikonz commented 2 years ago

@simonepsp Could you please share an update on this? Does the de-blobbed firmware boot? Thanks.

Serphentas commented 2 years ago

I just cleaned my MBP 15" Mid-2011 and it runs flawlessly past the 30 minutes mark, no problem with fans, display, keyboard backlight, etc. Note I do not run macOS and used me-cleaner on the ROM which I directly extracted from the chip.

mattdrepo commented 2 years ago

I just cleaned my MBP 15" Mid-2011 and it runs flawlessly past the 30 minutes mark, no problem with fans, display, keyboard backlight, etc. Note I do not run macOS and used me-cleaner on the ROM which I directly extracted from the chip.

Interesting - would you be willing to try running mac for users considering a dual boot scenario? I am considering doing this to my 13" 2011 macbook pro (intel only gpu - and thus needing a scenario whereby my gpu is supported - hearing it is not under mac - but then might have to use opencore perhaps and treat as "hackintosh") as well as the failing 17" 2011 model with gpu issues. Keeping these alive would be nice.

Serphentas commented 2 years ago

Interesting - would you be willing to try running mac for users considering a dual boot scenario? I am considering doing this to my 13" 2011 macbook pro (intel only gpu - and thus needing a scenario whereby my gpu is supported - hearing it is not under mac - but then might have to use opencore perhaps and treat as "hackintosh") as well as the failing 17" 2011 model with gpu issues. Keeping these alive would be nice.

I kept a small macOS partition for cases like this, and can report back that it runs OK on an empty desktop (haven't tried 3D apps). All components load just fine as seen in System Information, in particular both GPUs. Going past the 30 minutes mark reveals no underlying issue with ME being neutralized.

It should be noted I run Catalina thanks to a modded installer, because it normally won't install on this model. Also, GPU switch seems not to be effective because the battery drains quite fast (1% every few minutes).

Boot ROM Version: MBP81.0050.B00 SMC version: 1.69f4

mattdrepo commented 2 years ago

Interesting - would you be willing to try running mac for users considering a dual boot scenario? I am considering doing this to my 13" 2011 macbook pro (intel only gpu - and thus needing a scenario whereby my gpu is supported - hearing it is not under mac - but then might have to use opencore perhaps and treat as "hackintosh") as well as the failing 17" 2011 model with gpu issues. Keeping these alive would be nice.

I kept a small macOS partition for cases like this, and can report back that it runs OK on an empty desktop (haven't tried 3D apps). All components load just fine as seen in System Information, in particular both GPUs. Going past the 30 minutes mark reveals no underlying issue with ME being neutralized.

It should be noted I run Catalina thanks to a modded installer, because it normally won't install on this model. Also, GPU switch seems not to be effective because the battery drains quite fast (1% every few minutes).

Boot ROM Version: MBP81.0050.B00 SMC version: 1.69f4

There was an EFI variable you could "force" from a Linux install to keep the intel GPU as the main device (as these were all destined to fail using the ATI/AMD GPU). I remember when using the Intel GPU ordinarily (using the GFX switcher app) that battery drain wasn't an issue. Perhaps that is the side effect of nulling intel ME, perhaps not if the intel GPU can be forced on permanently. dosdude1 also has some insights as well as others with regards to flashing the controller on the 15" and 17" controller to permanently switch off the AMD chip.

mattdrepo commented 2 years ago

If you need me to find info and wish to try any of the steps. Let me know. I am running the 13" model now, but I am going to try and resurrect the 17" again when I have time (lot's wrong with it).

Serphentas commented 2 years ago

Indeed, it has to do with Apple's EFI implementation playing tricks with us, I tried one variable in rEFInd but to no avail. There are some commands one can run from macOS but I've yet to give those a shot. Do you have any success stories so far ?

mattdrepo commented 2 years ago

https://forums.macrumors.com/threads/disable-a-failed-amd-gpu-on-a-2011-macbook-pro-grub-solution.2087527/

This worked for me till resetting NVRAM (due to other issues). So be careful, you can recover. Just makes it a little harder to sometimes (target disk mode, removing the kext, repairing the volume from an install media etc). But I like how, once you have your setup to your liking, its more "forced" into place.

Actually re-flashing the controller is the long term safest way. I just have yet to do it (need to set up a work space).

mattdrepo commented 2 years ago

I would actually like to see how CoreBoot could work in place of apples EFI implementation, and how hackintoshing could be the future of these machines (I am quite happy to use Linux and keep an Apple partition for a few old software programs, IF the opencore/clover and CoreBoot implementations would work fine).