Jump to content

[UEFIPatch] UEFI patching utility


CodeRush
1,981 posts in this topic

Recommended Posts

How do I run the patch on the bios file if PMPatch says the files too big after compression?

 

EDIT: I pulled my bios using afudos, ran the patch on that file, and it's still saying that the file is too big after compression.  I thought it would be different if I did it this way but I got the same result. 

PowerManagement modules not found.
PowerMgmtDxe/PowerManagement2.efi modules not found.
Trying to apply patch #1
Nested PowerMgmtDxe/PowerManagement2.efi module at 001D0224 patched.
Patched module too big after compression.
Trying to apply patch #2
Nested PowerMgmtDxe/PowerManagement2.efi module at 001D0224 patched.
Patched module too big after compression.
Trying to apply patch #3
Nested PowerMgmtDxe/PowerManagement2.efi module at 001D0224 patched.
Patched module too big after compression.
Trying to apply patch #4
Nested PowerMgmtDxe/PowerManagement2.efi module at 001D0224 patched.
Patched module too big after compression.
Trying to apply patch #5
Nested PowerMgmtDxe/PowerManagement2.efi module at 001D0224 patched.
Patched module too big after compression.
AMI nest module at 00080048 not patched: Repacked module can't be inserted.
Phoenix nest modules not found.
CpuPei module at 005AD200 not patched: Patch pattern not found.

I've attached the file I pulled using afudos below. Please, help?

MYBOOT.zip

Link to comment
Share on other sites

Continuing the story started HERE
I've stumbled upon a similar procedure related to bit setting at LPC interface bridge  BIOS_CNTL register (see intel chipset spec) on boards which implement nvram write protection. Namely, the board under exam was GA-Z77X-UD5H. 

The module has GUID of 7B8DB049-C7C7-4D3B-809F-926DEE47CCA2 (SBSMI - Southbridge SMI ?). Since the address of BIOS_CNTL was first mentioned by CodeRush in the aforementioned post, this code snippet looks to be very closely related to the SMI handler which implies the lock we are so desperately trying to get rid of:

00000001800008fe E8410C0000                      call       0x180001544
0000000180000903 41B9DC000000                    mov        r9d, 0xdc
0000000180000909 4533C0                          xor        r8d, r8d
000000018000090c 24FE                            and        al, 0xfe 
000000018000090e B21F                            mov        dl, 0x1f
0000000180000910 33C9                            xor        ecx, ecx
0000000180000912 88442420                        mov        byte [ss:rsp+0x20], al
0000000180000916 E8CD0D0000                      call       0x1800016e8

The crucial byte here with the analogy to aforementioned research is 0xfe (NOT 0x01), which has to be inverted, hence changed to 0xff.

I have no way to personally test this myself as my board doesn't incorporate the lock (yet, lol). This will remove all BIOS region related write restrictions, meaning it would allow to reprogram on ASUS boards. If this fails in regards to nvram lock, there's a good chance that deleting the NvramSmi module completely from the firmware image will lift all the write-related restrictions. 

  • Like 2
Link to comment
Share on other sites

I must also add that SMM_BWP bit of BIOS_CNTL register must also be set to 0 for the metod above to work properly, as I have previously described, other way the system will hang up after the first try to write something in the SPI chip, but all other things including possible solution of good old NVRAM problem appears to be correct. I can't test it myself because of lack of locked hardware, but you have one - you are wellcome.

Link to comment
Share on other sites

Hi, i have a little problem, i'm playing with a laptop asus p551c i would like pmpatch bios, but it seem that i cant flash it with internal software, the software included in bios, someone knows some way to flash avoiding desoldering bios chip? 

Many thanks 

Link to comment
Share on other sites

Hi, i have a little problem, i'm playing with a laptop asus p551c i would like pmpatch bios, but it seem that i cant flash it with internal software, the software included in bios, someone knows some way to flash avoiding desoldering bios chip? 

Many thanks 

If your Asus laptop is like mine, you have to use afudos to pull a BIOS backup, patch the backup, and then use the afudos /gan method to flash it as mentioned somewhere in this thread. Unfortunately, this is not working for me as PMPatch is saying that the resulting file after patching is too large after compression. I've heard of others with the same laptop who have used this method with success, however. 

Link to comment
Share on other sites

I have a MSI GE70 2PE 012US laptop. I got a modded bios and disabled the MSR X02 or what ever it is called. I have mavericks installed on my laptop. But I get a lot of error when I try to compile a dsdt file is it because of my bios or after market hardware like ssd, upgraded memory, upgraded wifi card, if so what can I do about it. I system is awesome but my hdmi port doesn't work, audio ports don't work but I can load kext files, ethernet port doesn't work and won't see kext files, camera doesn't work or see kext files, screen brightness doesn't work so my battery is draining like crazy but, mostly everything else works. I even have full graphics acceleration. I just want to be able to compile a dsdt file without 70 errors.

Link to comment
Share on other sites

Hi ! I have asrock z87 exreme4 mb with 2.70 bios version. And i can't get output file when run PMPatch.

 

C:\bios>AFUWINx64 bios.bin /o
+---------------------------------------------------------------------------+
| AMI Firmware Update Utility v3.05.04 |
| Copyright ©2013 American Megatrends Inc. All Rights Reserved. |
+---------------------------------------------------------------------------+
Saving current BIOS into file: bios.bin
Reading flash ............... done

C:\bios>PMPatch bios.bin c:\bios\pmbios.bin
PMPatch 0.5.14
PowerManagement modules not found.
PowerMgmtDxe/PowerManagement2.efi modules not found.
Trying to apply patch #1
Nested PowerMgmtDxe/PowerManagement2.efi module at 001DB704 not patched: Patch p
attern not found.
AMI nest module at 000571C0 not patched: PowerManagement modules not found in ne
sted module.
Phoenix nest modules not found.
CpuPei module at 00560200 not patched: Patch pattern not found.

C:\bios>

 

Update:

 

Solved! Downgrade to 2.60 version which able to patch. Thanks CodeRush

Link to comment
Share on other sites

Thanks. I knew it's an OSX issue, but it will not be corrected until Apple implements UEFI 2.3.1C requirement level (i.e. SecureBoot tech support). 

You can also use UEFI shell to read and write runtime variables, it's easier then using Linux and special software. 

Link to comment
Share on other sites

Hello coderush,

 

I am trying to patch an Asus G750JX Laptop.  

 

C:\Users\osxfr33k\Desktop\G750JX>PMPatch_0.5.14 C:\Users\osxfr33k\Desktop\G7
\G750JXAS208\G750JXAS.208  C:\Users\osxfr33k\Desktop\G750JX\208_P\
PMPatch 0.5.14
PowerManagement modules not found.
PowerMgmtDxe/PowerManagement2.efi modules not found.
Trying to apply patch #1
Nested PowerMgmtDxe/PowerManagement2.efi module at 001D0224 patched.
Patched module too big after compression.
Trying to apply patch #2
Nested PowerMgmtDxe/PowerManagement2.efi module at 001D0224 patched.
Patched module too big after compression.
Trying to apply patch #3
Nested PowerMgmtDxe/PowerManagement2.efi module at 001D0224 patched.
Patched module too big after compression.
Trying to apply patch #4
Nested PowerMgmtDxe/PowerManagement2.efi module at 001D0224 patched.
Patched module too big after compression.
Trying to apply patch #5
Nested PowerMgmtDxe/PowerManagement2.efi module at 001D0224 patched.
Patched module too big after compression.
AMI nest module at 00080848 not patched: Repacked module can't be inserted.
Phoenix nest modules not found.
CpuPei module at 005ADA00 not patched: Patch pattern not found.
 
C:\Users\osxfr33k\Desktop\G750JX>
 
I want to patch  both the 208 and 209 bios.
 
both Bios attached.
 
Thanks
 
EDITED A FEW MINUTES LATER:
 
I used your EFItool its great and followed your directions and was able to patch 208 but wondering if you can patch 209 so I can compare and make sure I did it correctly.  What do you mean press RMB?   I see P32+ image do I right click on that one and extract body or press the keys simultaneously RMB?  I don't see a button RMB and when I press RMB together I end up on a file starting name B.
 
Thanks
 
 

G750JXAS208.zip

G750JXAS209.zip

Link to comment
Share on other sites

×
×
  • Create New...