Jump to content

[UEFIPatch] UEFI patching utility


1,981 posts in this topic

Recommended Posts

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 :)

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!

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.

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!

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.

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! (=

  • Like 1

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.

  • Like 1

PMPatch 0.5.10

PowerManagement module at 00302920 not patched: Patch pattern not found.

AMI nest modules not found.

Phoenix nest modules not found.

CpuPei module at 0057D5A8 not patched: Patch pattern not found.

 

Bios version 2.9

  • Like 1

PMPatch 0.5.10

PowerManagement module at 00302920 not patched: Patch pattern not found.

AMI nest modules not found.

Phoenix nest modules not found.

CpuPei module at 0057D5A8 not patched: Patch pattern not found.

 

Bios version 2.9

Looks like already patched BIOS.

Is it definitely incompatible with original kext? If so, we need to find new patch pattern to perform. Thank you for report.

HI i tryed to batch my sabertooth x79 bios

what i did was down load latest bios to usb and patched in terminal and renamed to bois file after patching

the bios loaded ok put i couldnt boot up after removing null cpu management kext

i had to reload the kext file and i could boot up

but my overclock was unstable so i replaced with standard bios

i hope the info helps with your development

  • Like 1

I have seen some issues with x79 boards, but I really don't know why OC can become unstable after the patch.

Repacking BEOS and becoming issues from it is only a sign of weak BIOS programming, which is common for ASUS boards.

Thank you for report but I don't know how to fix that.

Looks like already patched BIOS.

Is it definitely incompatible with original kext? If so, we need to find new patch pattern to perform. Thank you for report.

Yes I think its incompatible as I get a kernel panic if I dont use NullCPUPowerManagement.kext. Tried on bioses 2.10, 2.9 and beta 2.94 for my board in sig.

Here is the result

I wrote a batch file and prepared a set of tools (now for Windows and Intel-based machines only) to make all things from my previous post automatically.

For anyone who has unpatched BIOS and want to test this automatic Dump->Patch->Flash solution - you are welcome.

It works on ASUS Maximus IV Gene-Z and it will not work on Intel boards, but I hope it will work on any non-Intel board, including laptop ones.

PowerManagement AutoPatcher aka PMAP v0.1 for Windows

Download it, unpack and run PMAP.bat as Administrator. Thank you in advance and please report your results here.

 

Not working on hp 4530s

PowerManagement Autopatcher v0.1
This program will dump your BIOS region,
patch it with PMPatch and flash the resulting file back to BIOS chip.
WARNING: BIOS flashing is dangerous and requires exclusive access to SPI chip.
Please disable any antivirus software,
virtualisation or sandboxing tools before running this batch file.
Press any key to continue if you are ready.
Press any key to continue . . .
Reading BIOS dump to dump.bin file.
Intel (R) Flash Programming Tool. Version: 8.1.10.1286
Copyright (c) 2007 - 2012, Intel Corporation. All rights reserved.
Platform: Intel(R) HM65 Express Chipset
Reading HSFSTS register... Flash Descriptor: Valid
--- Flash Devices Found ---
MX25L3205D ID:0xC22016 Size: 4096KB (32768Kb)

- Reading Flash [0x400000] 2560KB of 2560KB - 100% complete.
Writing flash contents to file "dump.bin"...
Memory Dump Complete
FPT Operation Passed
Patching dump.bin with PMPatch
PMPatch 0.5.10
PowerManagement modules not found.
AMI nest modules not found.
Trying to apply patch #1
Nested PowerManagement2.efi module at 01689340 patched.
Phoenix nest module at 00030048 patched.
CpuPei modules not found.
Output file generated.
Flashing modified BIOS dump to BIOS chip
Intel (R) Flash Programming Tool. Version: 8.1.10.1286
Copyright (c) 2007 - 2012, Intel Corporation. All rights reserved.
Platform: Intel(R) HM65 Express Chipset
Reading HSFSTS register... Flash Descriptor: Valid
--- Flash Devices Found ---
MX25L3205D ID:0xC22016 Size: 4096KB (32768Kb)

Error 280: Failed to disable write protection for the BIOS space!
Flashing modified BIOS failed. Please report in PMPatch topic on InsanelyMac.com
forum. Exiting.
Press any key to continue . . .

  • Like 1

@CodeRush,

 

 

osxfr33ks-Mac-Pro-2:G74sx osxfr33k$ ./PMPatch G74SxAS.203 G74SxAS.203_patch

PMPatch 0.5.10

PowerManagement modules not found.

Trying to apply patch #1

Nested PowerManagement module at 00F900AC patched.

AMI nest module at 000B7720 patched.

Phoenix nest modules not found.

CpuPei module at 0027C2C0 not patched: Patch pattern not found.

Output file generated.

 

 

I have an Asus Gamers Laptop G74SX that I have to use the speedstep patching from that thread. Did your patch work on this particular UEFI bios and will I be able to update the bios on the notebook?

 

Asus Laptops use Asus brand boards not Intel as far as I know. Of course they are intel chipsets.

 

 

EDITED:

 

I attached both the original files from Asus and patched file.

G74SxAS203.zip

G74SxAS.203_patch.zip

  • Like 1
Here is the result

 

Not working on hp 4530s

PowerManagement Autopatcher v0.1
This program will dump your BIOS region,
patch it with PMPatch and flash the resulting file back to BIOS chip.
WARNING: BIOS flashing is dangerous and requires exclusive access to SPI chip.
Please disable any antivirus software,
virtualisation or sandboxing tools before running this batch file.
Press any key to continue if you are ready.
Press any key to continue . . .
Reading BIOS dump to dump.bin file.
Intel (R) Flash Programming Tool. Version: 8.1.10.1286
Copyright (c) 2007 - 2012, Intel Corporation. All rights reserved.
Platform: Intel(R) HM65 Express Chipset
Reading HSFSTS register... Flash Descriptor: Valid
--- Flash Devices Found ---
MX25L3205D ID:0xC22016 Size: 4096KB (32768Kb)

- Reading Flash [0x400000] 2560KB of 2560KB - 100% complete.
Writing flash contents to file "dump.bin"...
Memory Dump Complete
FPT Operation Passed
Patching dump.bin with PMPatch
PMPatch 0.5.10
PowerManagement modules not found.
AMI nest modules not found.
Trying to apply patch #1
Nested PowerManagement2.efi module at 01689340 patched.
Phoenix nest module at 00030048 patched.
CpuPei modules not found.
Output file generated.
Flashing modified BIOS dump to BIOS chip
Intel (R) Flash Programming Tool. Version: 8.1.10.1286
Copyright (c) 2007 - 2012, Intel Corporation. All rights reserved.
Platform: Intel(R) HM65 Express Chipset
Reading HSFSTS register... Flash Descriptor: Valid
--- Flash Devices Found ---
MX25L3205D ID:0xC22016 Size: 4096KB (32768Kb)

Error 280: Failed to disable write protection for the BIOS space!
Flashing modified BIOS failed. Please report in PMPatch topic on InsanelyMac.com
forum. Exiting.
Press any key to continue . . .

Try booting tour laptop by holding down: win+left atrow+right arrow when you hit the power button.

  • Like 1

Yes I think its incompatible as I get a kernel panic if I dont use NullCPUPowerManagement.kext. Tried on bioses 2.10, 2.9 and beta 2.94 for my board in sig.

Will look at it then. X79 boards are hard to patch, and I don't know if they can be patched at all, but not trying is not an option.

 

I tested the latest windows version on a MSI GT60 Laptop with the latest bios version. The result is in the picture (attechment)

Thanks for report, there is an example of normal PMAP log with all things gone right.

 

Not working on hp 4530s

BIOS write protection kicks in. Intel boards behave similar.

Read a manual to your laptop for instructions on disabling write protection. Try TimeWalker's method too.

Patch a normal BIOS file with PMPatch and try flashing it with HP flashing tools.

Report your results.

 

I have an Asus Gamers Laptop G74SX that I have to use the speedstep patching from that thread.

Did your patch work on this particular UEFI bios and will I be able to update the bios on the notebook?

If it patches and generates patched file then this patched file must be working. I can't guarantee it, but there was no corrupted image produced since version 0.5.3, and thre is only report of having isssues with OC stability after flashing patched BIOS.

Try PMAP first, if it works, you don't need anything else. If not - report and I will try to guide you further.

ASUS Sabertooth x79

Can you also try flashing patched BIOS with biosrefl.bat from FTK? Can you try not latest BIOS version but a one ore two previous ones? You can flash any version you want with FTK.

I think I know why this OC issues may be present, but I need more testing before I can fully explain it.

@codeRush.

sorry i didnt use your tool correctly in my first post my mistake was only puting bios file in terminal once. but i hve just but bios file in twice. and genarated a patched file.

this is my read out from terminal.

 

 

Desktop/SABERTOOTH-X79-ASUS-3305.CAP\ 2

PMPatch 0.5.10

PowerManagement modules not found.

AMI nest modules not found.

Phoenix nest modules not found.

CpuPei module at 0079A518 patched.

CpuPei module at 007DA518 patched.

Output file generated.

 

Now the motherboard will not read the patched file from the usb stick

  • Slice pinned this topic
×
×
  • Create New...