Jump to content

[UEFIPatch] UEFI patching utility

BIOS patch power management UEFI

  • Please log in to reply
1712 replies to this topic

#41
CodeRush

CodeRush

    InsanelyMac Sage

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

0.5.9 work good in MacOS but in 0.5.10 i get: "Illegal instruction"
Asus P8Z68 Deluxe Gen3 v3603

I have used XCode as compiler first time to see if it produces better code then GCC. It doesn't.
UPD: replaced with GCC-compiled version. Works fine on your BIOS.

#42
bdv

bdv

    InsanelyMac Protégé

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

bdv, done, this file can now be patched by version 0.5.10.


Yes!

$ ./PMPatch-0.5.10 x9sca2.917 x9sca2.917-P
PMPatch 0.5.10
PowerManagement modules not found.
Trying to apply patch #1
Nested PowerManagement module at 00E36344 patched.
Gap module inserted after repacked module.
AMI nest module at 00460048 patched.
Phoenix nest modules not found.
CpuPei module at 007B93F0 not patched: Patch pattern not found.
Output file generated.

Thanks. :)

#43
CodeRush

CodeRush

    InsanelyMac Sage

  • Developers
  • 412 posts
  • Gender:Male
  • Location:Deggendorf, Germany
bdv, no problem. Can you report if modified BIOS works so I can add SuperMicro (AMI) to the list of tested models?

#44
bdv

bdv

    InsanelyMac Protégé

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

bdv, no problem. Can you report if modified BIOS works so I can add SuperMicro (AMI) to the list of tested models?


Will do as soon as I'll get a Core proc to go with the DDR3 ram, or ECC ram to go with the Xeon. :)

#45
CodeRush

CodeRush

    InsanelyMac Sage

  • Developers
  • 412 posts
  • Gender:Male
  • Location:Deggendorf, Germany
Has anyone a Biostar or Foxconn board to test a patched BIOS? I see that patching with 0.5.10 works, but I can't prove it working without actual testing.

#46
tonydickinson

tonydickinson

    InsanelyMac Geek

  • Donators
  • 190 posts
  • Gender:Male
  • Location:Singapore
CodeRush - Great - thank you very much works perfectly on an Asus Z77 Sabertooth.

#47
Kogen Mantis

Kogen Mantis

    InsanelyMac Protégé

  • Donators
  • 98 posts
  • Gender:Male
Works perfect on Lenovo ThinkPad T420
(UEFI Bios was first patched to remove whitelist)

$ /Users/k0gen/Downloads/PMPatch /Users/k0gen/Desktop/Thinkpad_T420_1.43_83uj25us_NWL/83uj25us_NWL/83ET73WW/\$01C8000.FL1 /Users/k0gen/Desktop/Thinkpad_T420_1.43_83uj25us_NWL/83uj25us_NWL/83ET73WW/\$01C8000_XYZ.FL1
PMPatch 0.5.10
PowerManagement modules not found.
AMI nest modules not found.
Nested PlatformSetupAdvancedDxe.efi at 0075B740 patched.
Trying to apply patch #1
Nested PowerManagement2.efi module at 00C37340 patched.
Phoenix nest module at 005497A8 patched.
CpuPei modules not found.
Output file generated.


#48
The Real Deal

The Real Deal

    InsanelyMac Legend

  • Donators
  • 930 posts
  • Gender:Male
  • Location:France

0.5.9 work good in MacOS but in 0.5.10 i get: "Illegal instruction"
The same command for 0.5.9 work fine.

Asus P8Z68 Deluxe Gen3 v3603



Same here :


Last login: Sat Jan 26 20:43:17 on ttys000
iMac-de-Nicolas:~ Nicolas$ /Users/Nicolas/Desktop/PMPatch /Users/Nicolas/Desktop/MAXIMUS-V-FORMULA-ASUS-1604.ROM /Users/Nicolas/Desktop/MAXIMUS-V-FORMULA-ASUS-1604PATCHED.ROM
Illegal instruction
iMac-de-Nicolas:~ Nicolas$

Snow Leopard/Maximus V Formula (UEFI Bios / Z77)

#49
CodeRush

CodeRush

    InsanelyMac Sage

  • Developers
  • 412 posts
  • Gender:Male
  • Location:Deggendorf, Germany
It's interesting as hell. Try version for Windows, if you can. I will rebuild it with GCC 4.7 tomorrow.

#50
CodeRush

CodeRush

    InsanelyMac Sage

  • Developers
  • 412 posts
  • Gender:Male
  • Location:Deggendorf, Germany
I have just tested 0.5.10 binary and it works on MVF 1604 file on my machine.
UPD: OS X rebuilt once again. Test it, please.
UPD2: I compiled it statically with GCC 4.7.2 now, try that file if normal doesn't work for you.

#51
CodeRush

CodeRush

    InsanelyMac Sage

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

Maximus V Formula

Here is your patched BIOS file, if new versions still don't work.

Attached Files



#52
The Real Deal

The Real Deal

    InsanelyMac Legend

  • Donators
  • 930 posts
  • Gender:Male
  • Location:France
Hi CodeRush, i am currently installing a dedicated ML partition to verify if the issue is reproductible or not.
I will test the new compiled version and report as soon as possible.
And thanks a lot for the modified BIOS, much appreciated :)

#53
eurisko

eurisko

    InsanelyMac Protégé

  • Members
  • Pip
  • 12 posts
  • Location:Lisbon,Portugal
Hi thanks for your work,

No sucess with the uefi from the Asrock H61M-S v 1.50

eurisko$ ./PMPatch H61MS1.50 MODH61MS1.50
PMPatch 0.5.10 PowerManagement modules not found.
Trying to apply patch #1 Nested PowerManagement module at 00A83594 patched.
Patched module too big after compression.
Trying to apply patch #2 Nested PowerManagement module at 00A83594 patched.
Patched module too big after compression.
Trying to apply patch #3 Nested PowerManagement module at 00A83594 patched.
Patched module too big after compression.
Trying to apply patch #4 Nested PowerManagement module at 00A83594 patched.
Patched module too big after compression.
Trying to apply patch #5 Nested PowerManagement module at 00A83594 patched.
Patched module too big after compression.
AMI nest module at 001A0048 not patched: Repacked module can't be inserted.
Phoenix nest modules not found.
CpuPei module at 0039F240 not patched: Patch pattern not found.

Thanks!

#54
CodeRush

CodeRush

    InsanelyMac Sage

  • Developers
  • 412 posts
  • Gender:Male
  • Location:Deggendorf, Germany
eurisko, thanks for report, will look at it after 5. Feb.
Asrock are using LZMA to compress BIOS modules, and I think a small tweak of compression parameters may help.
Another option is to eliminate some dead code (if any) with NOPs to earn some space.
Please wait a bit, I don't have time for programming now.

#55
giacomoleopardo

giacomoleopardo

    InsanelyMac Protégé

  • Members
  • PipPip
  • 63 posts
  • Gender:Male
Noob question: does this mean a successfull patch?


PMPatch 0.5.10
PowerManagement module at 00459ECC patched.
AMI nest modules not found.
Phoenix nest modules not found.
CpuPei module at 001FBB6C not patched: Patch pattern not found.
Output file generated.

If yes, then Intel® Desktop Board DH77DF bios version 0107 patched.
Please confirm that.

Great job!

#56
CodeRush

CodeRush

    InsanelyMac Sage

  • Developers
  • 412 posts
  • Gender:Male
  • Location:Deggendorf, Germany
giacomoleopardo, it does, but the problem is with flashing that modified BIOS on Intel boards. BIOS modules on modern Intel boards are protected by RSA-based digital signature, so the modified BIOS will be refused to flash in almost all cases. There is actually a method to flash it, but it's risky. Read this topic from the beginning to know more, I've already explained it.
I don't have Intel board to test it myself, thats why I can't guarantee it works, but you can try it, if you wish.

#57
giacomoleopardo

giacomoleopardo

    InsanelyMac Protégé

  • Members
  • PipPip
  • 63 posts
  • Gender:Male
I see.
Since I don't have that board (yet) I can't test by myself. But I'm looking testers (I really like this board features). I'll post results as soon as I can.
Thanks man!

#58
CodeRush

CodeRush

    InsanelyMac Sage

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

Asrock H61M-S v 1.50

Can you use v1.80?
It works with current version.

#59
taney

taney

    InsanelyMac Protégé

  • Members
  • Pip
  • 42 posts
  • Gender:Male
  • Location:Southern California
Anyone try this on ASUS laptops? I'm using this for my desktop (ASUS Maximus V Gene) without any issues, but there is Flashback intact in case of failures. I want to try this on my Zenbook (UX32VD-DB71). Any pointers?


Thanks again for all your hard work! (=

#60
CodeRush

CodeRush

    InsanelyMac Sage

  • Developers
  • 412 posts
  • Gender:Male
  • Location:Deggendorf, Germany
There is little to no difference between AMI BIOSes on modern ASUS desktops and ASUS laptops, so I can't see why it won't work.
The main problem is again with flashing, because EZ Flash or BUpdater can refuse to flash a modified BIOS and I don't know how to bypass that protection, but there is a way to integrate a patch into BIOS without taking much risk:
1. Download Intel Flash Programming Tool compatible with your laptop. You can try FPT v8 (99% chance to work) from my FTK toolset.
2. If you are using FTK, go to Win32 or Win64 folder and run biosbkp.bat as Administrator using right-click menu.
3. I'm assuming you can boot to Windows on your laptop, if not - here is an image of DOS-bootable USB-Flash with FTK, that can be written with dd, named FTK_x.y.z_bin.zip.
4. Anyway, run Command Prompt as Administrator and cd to FTK/Win32 or FTK/Win64 folder.
5. Enter fpt -bios -d bck.bin command, if it ends with green "FPT Operation Passed" message - you have now a dump of your BIOS region.
6. Patch this dump file with PMPatch, producing bck.mod file. Copy that modified file to FTK/Win32 or FTK/Win64 folder.
7. Flash your modified dump back by executing fpt -bios -f bck.mod command. If it doesn't fails and green "FPT Operation Passed" message is present - you are done.
8. Reboot and see what happens. I can't guarantee anything, but there is only a little chance of fail, as I see it.
You can try it on your desktop board first to see it working.
I'm thinking about an automated solution for that, because it's easy to a write a batch file for doing all of that things in one seat. Will do it a bit later when I have more time for programming.





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


5 user(s) are reading this topic

1 members, 3 guests, 1 anonymous users


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