Jump to content

[PMPatch] UEFI patching utility

BIOS patch power management

  • Please log in to reply
1395 replies to this topic

#1
CodeRush

CodeRush

    InsanelyMac Sage

  • Developers
  • 353 posts
  • Gender:Male
  • Location:Deggendorf, Germany

*
POPULAR

Good day to all.

I wrote an utility to patch modern UEFI BIOSes from different vendors to prevent them from locking MSR 0xE2 and therefore make the system with patched BIOS compatible with native OS X power management.
It's tested on AMI, Phoenix and Insyde UEFI BIOSes and it works.

This patch works on boards based on 5th, 6th, 7th and 8th series of Intel chipsets, so NM10 and similar ones are supported - there is nothing to patch in that BIOSes.

 

The utility is BSD-licensed and available on GitHub.
Compiled versions for Windows and OS X are here.

Latest version is 0.5.14

Usage: pmpatch /path/to/original.bios /path/to/patched.bios

This program can produce corrupt BIOS images, try them on your own risk.
Please attach AIDA64's or DarwinDumper's report file to your "PMPatch didn't work for me" message.

Thank you in advance.

F.A.Q.

1I have many "... not found" messages in program output, is it bad?

-- No, if the last message is "Output file generated", it's OK to have any other messages.

 

2. I have patched my BIOS, can you guarantee it will work after flashing?

-- No, but there are many people with patched BIOSes of all kinds, and very few negative reports.

 

3. I can't flash my patched BIOS due to "security verification failed", what can I do?

-- If you have ASUS board with USB BIOS Flashback support, use it to flash your modified BIOS.

-- If you have AMI UEFI BIOS (all modern desktop boards now have one, DO NOT TRY IT ON NOTEBOOKS), then you can use this method.

-- If you have non-AMI BIOS, I don't know any 100% working method except using external programmer, which are cheap and fast nowadays. 

 

4. Program version for OS X crashes with "Segmentation fault" message, what to do now?

-- It's a known issue with LZMA compression code compiled by Apple compilers, please try using version for Windows.



#2
TimeWalker75a

TimeWalker75a

    InsanelyMac Legend

  • Gurus
  • 862 posts
  • Gender:Male
For Dell machines with Phoenix Secure Core Tiano UEFI 2.0, such as Vostro 3750, L502x etc you can apply the patch straight to the .exe you have got from Dell.
Then flash it as if it was a stock updater thereafter. As said in the original post it will unlock all the advanced menus available for a particular machine you are patching for. The patch sequence used in this utility has originated from bios-mods, you can read this article for in-depth details on the advanced menus.

#3
k3nny

k3nny

    InsanelyMac Legend

  • Members
  • PipPipPipPipPipPipPip
  • 522 posts
  • Gender:Male
Confirmed working on ASUS P8Z77-V LK v0908 CAP (capsule) file.

#4
CodeRush

CodeRush

    InsanelyMac Sage

  • Developers
  • 353 posts
  • Gender:Male
  • Location:Deggendorf, Germany
k3nny, FTK for Windows is easier to use and don't have any CAP verification at all, but I still don't recommend to flash BIOS under Windows - it's way too risky.
Any other system program or driver can interfere with flashing process and make unpredictable results. With strong antivirus or virtual machine enabled this chance is rather high.
It's less dangerous to use flashrom under Linux or OS X, but DOS or is still better, because nothing can interfere with flashing process in single task system (if a bunch of drivers and/or TSR's don't loaded, of course).
More to say, flashing with non-Asus tools leads to individual data loss, so now you have to restore your SMBIOS UUID, LAN MAC and Motherboard S/N using FD44Editor and then reflash BIOS to write the restored data.
Read my post on [H] linked above.

#5
k3nny

k3nny

    InsanelyMac Legend

  • Members
  • PipPipPipPipPipPipPip
  • 522 posts
  • Gender:Male
Thanks for the hint. I will look into this.

#6
CodeRush

CodeRush

    InsanelyMac Sage

  • Developers
  • 353 posts
  • Gender:Male
  • Location:Deggendorf, Germany
New version - 0.5.9
Changes: solved a bug in free space calculation, more BIOSes can be patched.
Thanks to phpdev32, author of DPCIManager.

#7
buoo

buoo

    The Prodigal Son

  • Moderators
  • 4,517 posts
  • Gender:Male
  • Location:Italy
Hi CodeRush :)

Is the patch applied by your utility the same of this ? http://www.insanelym...vy-bridge-bios/

#8
CodeRush

CodeRush

    InsanelyMac Sage

  • Developers
  • 353 posts
  • Gender:Male
  • Location:Deggendorf, Germany
buoo, yes and no.
The pattern to find is also 75080fbae80f89442430, but there are 6 different patch variants that the program is trying to perform.
I have made an analysis of that assembly (warning, crappy Google-translate from Russian) and now is a bit more complex then just patching 0x75 to 0xeb.
Different patch variants are needed because after 0x75 to 0xeb patch the compressed module is often 1 byte bigger than original and there are BIOS versions that don't have even 1 byte of free space to insert it.

#9
CodeRush

CodeRush

    InsanelyMac Sage

  • Developers
  • 353 posts
  • Gender:Male
  • Location:Deggendorf, Germany
Confirmed working on Intel DQ77KB, modified .BIO file can be flashed with F7 update utility.

#10
oswaldini

oswaldini

    InsanelyMac Geek

  • Members
  • PipPipPip
  • 137 posts
  • Gender:Male
  • Location:Cracow, Poland
Doesn't work with Lenovo ThinkPad R61i 8932-FDG (Phoenix) and Intel SC5520SC (*.cap EFI bioses)

Intel SC5520SC: http://downloadcente...Y&DwnldID=18951

#11
CodeRush

CodeRush

    InsanelyMac Sage

  • Developers
  • 353 posts
  • Gender:Male
  • Location:Deggendorf, Germany

Lenovo ThinkPad R61i 8932-FDG (Phoenix)

Not an UEFI, can't be patched with this program.

Intel SC5520SC

Has different module organisation and doesn't have PowerManagement or CpuPei modules to patch.
Is a patch required for this board to work with native AppleICPM.kext? Is there any patched BIOS for this board anywhere?

#12
oswaldini

oswaldini

    InsanelyMac Geek

  • Members
  • PipPipPip
  • 137 posts
  • Gender:Male
  • Location:Cracow, Poland
Lenovo ThinkPad R61i and Intel SC5520SC require patching AICPUPM.kext. I haven't seen anyone who patched Intel EFI BIOSes.

EDIT: about Lenovo:

UEFI BIOS Version 8JET42WW (1.36) 
UEFI BIOS Date 2012-05-15


#13
CodeRush

CodeRush

    InsanelyMac Sage

  • Developers
  • 353 posts
  • Gender:Male
  • Location:Deggendorf, Germany
oswaldini, 8JET42WW can be patched by version 0.5.9 after unpacking, BIOS file to patch is $0A8J000.FL1
There is no problem to patch Intel EFI file, the main problem is to flash patched file to BIOS chip on Intel boards.
I don't know any method to flash modified Intel BIOSes with standard Intel tools, but I do know two methods to unlock access to whole BIOS and flash it with Intel Flash Programming Tool.
Another possible way to flash modified BIOS is described by phpdev32 in his mail:

I can report that the Intel DQ77KB thin mITX build I made this weekend worked just fine. Naturally I tested the newest ROM with PMPatch before I even bought the parts (just to be safe), but the F7 BIOS flasher worked just fine. I'm pretty sure the recovery flash didn't work, restarted several times without flashing, but that isn't critical. I imagine anyone wanting to repair the BIOS could flash the stock first using recovery, then flash the patched using F7 after rebooting.



#14
oswaldini

oswaldini

    InsanelyMac Geek

  • Members
  • PipPipPip
  • 137 posts
  • Gender:Male
  • Location:Cracow, Poland
Thanks for the info. About Lenovo... Facepalm ! I think about E420s, not R61i

#15
314TeR

314TeR

    InsanelyMac Protégé

  • Members
  • PipPip
  • 75 posts
  • Gender:Male
  • Location:Poland
Confirmed working on P8Z68 Deluxe/GEN3. I tested version 3202, 3304 and 3603. All works ok, flashed by bupdater under dos.

#16
CodeRush

CodeRush

    InsanelyMac Sage

  • Developers
  • 353 posts
  • Gender:Male
  • Location:Deggendorf, Germany
I have ASUS Maximus IV Gene-Z in main system and therefore ASUS boars are well supported and tested. Thanks for report.

#17
bdv

bdv

    InsanelyMac Protégé

  • Donators
  • 61 posts
  • Gender:Male
  • Location:France, Near Bordeaux
  • Interests:Italian motorcycles riding and fixing, computers, cats, pre-print design.

The utility is BSD-licensed and available on GitHub.
Compiled versions for Windows and OS X are here.
Latest version is 0.5.9


Much better and easier than doing it under windows with Phoenix tools and an hex editor. :)
Thumb up.

I need testers with different boards from different vendors to make the utility better, so if you have enough courage or a spare BIOS chip - please try it and report in this topic.
Thank you in advance.


Tested on my Asus P8B-WS, bios 2106 (previously patched) with a Xeon E3-1230v2.
Works without any problem, a binary file compare show differences with my "hand-patched" bios but I can't see any differences under UEFI bios screens nor working under ML 10.8.2
Sleeps and wakes as usual, speedstep is the same using the same SSDT with modified iMac12_2.plist :

MSRDumper PStatesReached: 16 20 27 33 35 36 37.

Nice work !

#18
CodeRush

CodeRush

    InsanelyMac Sage

  • Developers
  • 353 posts
  • Gender:Male
  • Location:Deggendorf, Germany

I can't see any differences under UEFI bios screens nor working under ML 10.8.2

It's normal, for AMI UEFI it only patches PowerManagement module and nothing more. Thank you for report.

#19
DislikeYou

DislikeYou

    InsanelyMac Geek

  • Members
  • PipPipPip
  • 101 posts
Did not work for me on Intel DZ77GA70K. I press F7 and then select .bio file and PC reboots and tries to flash but then reboots again and boots into Windows.

C:\>pmpatch GA0061.bio GA0061A.bio
PMPatch 0.5.9
PowerManagement module at 0045CC8C patched.
AMI nest modules not found.
Phoenix nest modules not found.
CpuPei module at 001FE83C not patched: Patch pattern not found.
Output file generated.


#20
CodeRush

CodeRush

    InsanelyMac Sage

  • Developers
  • 353 posts
  • Gender:Male
  • Location:Deggendorf, Germany
Intel is famous for difficulties on flashing modified BIOSes...
I know a way to overcome it, but it isn't simple.
Please download FTK for Windows from the link in third post, then open Administrator console, cd to FTK/Win32 and execute fpt -i command.
I need the output to guide you further.





Also tagged with one or more of these keywords: BIOS, patch, power management


2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users

© 2014 InsanelyMac  |   News  |   Forum  |   Downloads  |   OSx86 Wiki  |   Mac Netbook  |   Web hosting by CatN  |   Designed by Ed Gain  |   Logo by irfan  |   Privacy Policy