Jump to content

[UEFIPatch] UEFI patching utility


CodeRush
1,981 posts in this topic

Recommended Posts

@Coderush, i try to, but i dont understand how.

In mmtool we see volume on which can operate, in uefiools i see only 4 guid but i dont know the numbering of volume.

Another question, it's mandatory put ozmosis stuff in volume 2? 

many thanks, and if i'm OFF-TOPIC delete all :D 

Link to comment
Share on other sites

Aigors, there is no such thing like "a number of volume". Numbers was introduced in MMTool, because it can't show the hierarchy of image components in TableView.

UEFITool and PhoenixTool, in the other hand, are using TreeView to show image structure. Just click LMB on GUID to see what is inside.

It's mandatory to put Osmozis stuff to the volume, where DXE Core is located. In your case, it's a volume inside a compressed section of a file named FV_NESTED (or similar).

It's a bit of offtopic here, but you can leave it as is, I think.  

Link to comment
Share on other sites

Thanks for the kind offer. Where can I get SCEWIN_64 from please?

And what exactly is  nvram.txt and where does it write it back to, BIOS, board?

 

looks like you can find SCE@MDL

nvram.txt contains bios settings stored in nv-data section, but not all those settings are visible

in uefi menu ;) and that's where SCE comes into play ...

Link to comment
Share on other sites

I ran it on windows and linux too, but on linux you'd have to compile the module.

 

SCEWIN_64 /o /s nvram.txt /h Hii.db /v /q

 

dumps the nvram-data to nvram.txt and

 

SCEWIN_64 /i /s nvram.txt

 

writes back the nvram.txt. If you have any fear to brick your board you can also attach your nvram.txt and I'll change it for you correctly.

OK, so I now have SCEWIN (AMISCE Utility. Ver 2.02.1036) is this version OK?

So I run SCEWIN_64 /o /s nvram.txt /h Hii.db /v /q whilst booted in windows 64 bit to create the nvram.txt file, SCEWIN for windows 32 bit.

Do the edits on the nvram.txt file then run SCEWIN_64 /i /s nvram.txt in Windows which writes in back to the bios and removes the current protection on my board?

Then I can update my BIOS to the latest version using FTK, etc?

Is this all correct?

Link to comment
Share on other sites

OK, so I now have SCEWIN (AMISCE Utility. Ver 2.02.1036) is this version OK?

So I run SCEWIN_64 /o /s nvram.txt /h Hii.db /v /q whilst booted in windows 64 bit to create the nvram.txt file, SCEWIN for windows 32 bit.

Do the edits on the nvram.txt file then run SCEWIN_64 /i /s nvram.txt in Windows which writes in back to the bios and removes the current protection on my board?

Then I can update my BIOS to the latest version using FTK, etc?

Is this all correct?

 

yes but you'll have to be careful on the setting, it's explained anyway in the dump, look:

 

Setup Question    = SMI Lock

Token    =47    // Do NOT change this line

Offset    =88

Width    =01

BIOS Default    =[00]Disabled

Options    =*[00]Disabled    // Move "*" to the desired Option

         [01]Enabled

 

Setup Question    = BIOS Lock

Token    =48    // Do NOT change this line

Offset    =89

Width    =01

BIOS Default    =[00]Disabled

Options    =*[00]Disabled    // Move "*" to the desired Option

         [01]Enabled

 

Setup Question    = GPIO Lock

Token    =49    // Do NOT change this line

Offset    =8A

Width    =01

BIOS Default    =[00]Disabled

Options    =*[00]Disabled    // Move "*" to the desired Option

         [01]Enabled

 

Setup Question    = BIOS Interface Lock

Token    =4A    // Do NOT change this line

Offset    =8B

Width    =01

BIOS Default    =[00]Disabled

Options    =*[00]Disabled    // Move "*" to the desired Option

         [01]Enabled

 

Setup Question    = RTC RAM Lock

Token    =4B    // Do NOT change this line

Offset    =8C

Width    =01

BIOS Default    =[00]Disabled

Options    =*[00]Disabled    // Move "*" to the desired Option

         [01]Enabled

 

and you'll have to change it twice, as those options appear a second time further below.

 

enabling an option would look like that:

 

BIOS Default    =[01]Enabled

Options    =[00]Disabled    // Move "*" to the desired Option

         *[01]Enabled

 

watch out for the BIOS Default Settings too. I changed the ones you see here to disabled, which means on 'load defaults'

everything's still unlocked. Don't delete any lines, don't remove an option and it will work fine.

Link to comment
Share on other sites

So just to get this straight.....

I am currently on BIOS 2203, and want to go to the latest 2303, do I need to goto 2303 stand BIOS first, or just do the below procedure?

 

1. SCEWIN_64 /o /s nvram.txt /h Hii.db /v /q whilst booted in windows 64 bit to create the nvram.txt file.

2. Send the nvram.txt file to you to do the edits, so I know it's done correct.

3. run SCEWIN_64 /i /s nvram.txt in Windows which writes in back to the bios and removes the current protection on my board.

4. Use PMPatch to patch 2303 BIOS (latest one)

5. Use FTK to flash BIOS to patched 2303.

6. Cross fingers and hope for the best!

Edited by Gringo Vermelho
fullquote removed
Link to comment
Share on other sites

Kill.Javascript, ...Here is your patched file, BTW, you can flash it with FTK.

 

Greetings, Coderush:
 
I tried to re-flash my bios (recall that I successfully upgraded it from 0904 to 1006 using FTK/DOS) using your patched bios, but was unsuccessful.
 
Rather than giving you an entire screen dump, here are the lines that seemed to reflect the reason why it failed:
======
FPT Operation Passed
Copying module data from BIOS region backup to bios.bin
DOS/4GW Protected Mode Run-time Version 1.97
Copyright © etc...
ASUS BIOS file signature not found in input file
Error occured during copy phase. Exiting.
Thank you for using FTK. Have a nice day.
 
C:\>
======
Do you think the reason this happened is that, after I upgraded the BIOS from 0904 to 1006; the new BIOS is not able to be flashed in the same way? Meaning, is the ASUS tool required? Just curious...
 
Thanks anyway, friend.
Link to comment
Share on other sites

Aigors, sure.

 

Arkanis, please read FAQ in first post.

 

Code,

 

I did that, trying to use the command referenced in that post, but I'm hitting an error from the application telling me the BIOS file size isn't the same then it stops. Any idea how to circumvent that ? (I'm using the /gan option).

 

A.

Link to comment
Share on other sites

Arise, you are right. I will now show you and others how UEFITool can be handy for such mods.

It will be automated there someday, but right now, here is the guide:

1. Download latest version of UEFITool from here.

2. Open your BIOS file. If it fails to open, check it for being UEFI BIOS. Legacy ones are not supported.

sybx.png

3. Select "File->Search..." (or press Ctrl+F) and enter "75080FBAE80F89442430" as hex pattern, set search scope to "Body only".

wxgp.png

4. Look for "Hex pattern found" string in Messages field, double-click on it to select found section. If not found - you have nonstandard BIOS that needs to be studied further, please upload it here.

mhwg.png

5. Press RMB on found section and select "Extract body..." action. "Save file..." dialog will open, enter the name of file to save, for example, "pm.bin", and press Save.

sykt.png

6. Open saved file with hex editor, find that "75080FBAE80F89442430" pattern once again, replace 75 to EB and save modified file.

mdxq.png

7. Select the same section you have found in step 4, press RMB and select "Replace body..." action. Select your modified "pm.bin" file in "Open file..." dialog, that will open and press Open. Old section will be marked "Remove", and another section marked "Replace" will be added after it.

u4t7.png

8. Select "File->Save image file..." (or press Ctrl+S) and save your modified BIOS.

9. Reopen the saved file to see that it opens correctly.

10. Flash the result with any suitable method.

---

This guide can be followed for any particular patch pattern, but have in mind that UEFITool is still in early beta stages and it can produce corrupt BIOS images.

Try them on your own risk, but please, try it. Without testing it's very hard to develop something useful, and my testing possibilities are very limited.

But, if you have any working recovery solutions, you can test UEFITool-made mods.

Let's make it better together.

 

 

I just know what to search for. ;)

The patch is "0F BA 6C 24 38 0F" -> "0F BA 74 24 38 0F" (Bit Test and Set command -> Bit Test and Reset command with the same argument).

attachicon.gifX79E4_3.40_PM.zip

 

Thanks for this guide and the patch for x79 board. I patch a Gigabyte UD3 X79 and it work flawlessly. :thumbsup_anim:

Link to comment
Share on other sites

Thanks for this guide and the patch for x79 board. I patch a Gigabyte UD3 X79 and it work flawlessly. :thumbsup_anim:

Code Rush, Before the patch my bios the sleep and wake works well using the clover in uefi boot but after the patch my hack goes to sleep but never wakes, My solution, use a clover in legacy mode and back my sleep and wake to works. is clover issue or a patch issue???

Link to comment
Share on other sites

DKMN, you can use RW Everything to with MSR 0xE2 register value, if bit 15 is set - it's locked, if not - the problem is somewhere else.

 

CodeRush, 

Back in town and working on this. I booted to Win7x64 native and downloaded RW-Everything. Under the MSR Registers listing, I clicked to add a User value and put in "0xE2" (verbatim, that seemed most correct with respect to endian-ness). I got "1E000407" back as a result, which when converted to binary has bit 15=0. 

Does this procedure sound correct to you? 

This would indicate that this MSR is not locked under BIOS 4404 for P9X79WS, if I understand correctly... If so, back to the drawing board as a "Sandy Bridge v1" refugee, LOL. 

Thanks again!

David

Link to comment
Share on other sites

HI ALL,

 

I am trying to patch my ASUS X79 deluxe with 701 Bios to get benefit of the OC of my 4930K at 4.4GHz currently.

I tried to use this / and get error messages can be seen; any ideas to overcome this and to get it to work?

 

ivysix:~ computer$ /PMPatch /Users/computer/Desktop/X79-DELUXE-ASUS-0701.CAP /Users/computer/Documents/X79-DELUXE-ASUS-0701.CAP 

PMPatch 0.5.14

PowerManagement module at 004CD110 not patched: Patch pattern not found.

PowerMgmtDxe/PowerManagement2.efi modules not found.

AMI nest modules not found.

Phoenix nest modules not found.

CpuPei module at 0079FF48 not patched: Patch pattern not found.

CpuPei module at 007DFF48 not patched: Patch pattern not found.

ivysix:~ computer$ /PMPatch /Users/computer/Desktop/X79-DELUXE-ASUS-0701.CAP /Users/computer/Documents/X79-DELUXE-ASUS-0721.CAP

PMPatch 0.5.14

PowerManagement module at 004CD110 not patched: Patch pattern not found.

PowerMgmtDxe/PowerManagement2.efi modules not found.

AMI nest modules not found.

Phoenix nest modules not found.

CpuPei module at 0079FF48 not patched: Patch pattern not found.

CpuPei module at 007DFF48 not patched: Patch pattern not found.

 

 

highly appreciate your help

best jw

Link to comment
Share on other sites

I am trying to patch my ASUS X79 deluxe with 701 Bios to get benefit of the OC of my 4930K at 4.4GHz currently.

 

Coderush has said several times that pmpatch can not patch Asus X79 Bios. They use a yet-to-be-discovered way to lock MSR 0xE2.

 

Patching your BIOS with pmpatch does not resolve overclocking issues. An SSDT generated with SSDTPrGen.sh along with appropriate boot loader configuration and model identifier can, but you will need working CPU power management for it to have any effect.

 

You can try using the Clover boot loader and set AsusAICPUPM=yes in config.plist.

If that doesn't work, you can patch the kernel so that it doesn't try to write to MSR 0xE2.

If that doesn't work either, you can block AppleIntelCPUPowermanagement from loading with NullCPUPowermanagement.kext (google it).

Link to comment
Share on other sites

Does this procedure sound correct to you? 

Fully. Your BIOS is factory unlocked.

jw0512, check your 0xE2 value to have bit 15 set, you can use RW Everything on Windows or rdmsr tool on OS X.

 

Gringo Vermelho, 2011 support was added with OSX 10.9.1, register layout is the same, but most of new BIOSes for X79 boards are factory unlocked.

  • Like 1
Link to comment
Share on other sites

hi CodeRush; with the help of many experienced hackintosh supporters, I was finally able to get it so far to have OSX 10.9.2 working stable on the x79.

I´m not familiar with all that programming stuff/details - so having googled for rdmsr and what it does; but I am afraid as I am such a newby, I need some more basic help

with this.

concrete asks are; What I need to do in what order ?

 

thank you

best jw

Link to comment
Share on other sites

Code Rush, I compared a Asus rampage iv extreme bios with the gigabyte bios. The gigabyte x79 ud3 is 0F BA 6C 24 38 0F and after the patch is 0F BA 74 24 38 0F but the asus that is factory unlocked is 0F BA 6C 24 38 0A. This has to do something with the sleep and wake works on the asus and not with the gigabyte?

Link to comment
Share on other sites

stinga11, this is a complete different function there. I think the reason for sleep problems is changes in UEFI structure made by UEFITool, try using PhoenixTool instead. I will debug this issue if I have an affected system to test on.

  • Like 1
Link to comment
Share on other sites

×
×
  • Create New...