Jump to content

[UEFIPatch] UEFI patching utility


CodeRush
1,981 posts in this topic

Recommended Posts

Hi CodeRush, one question not directly connected to your tools, I bought a hardware programmer named sofi sp8, it comes with few usefull adaptor, the usage it seem so easy, but if i try to read bios-chip from ASUS  i can't obtain a .cap file, if i save as file.bin and try to open with your uefitool, i saw only intel image type, it seems that i have to setup some options to do a raw backup.

As far you know, are there some option that i have to check to obtain a raw bios backup? 

 

Many thanks

 

If you mind that this message are off-topic, no problem :D 

Link to comment
Share on other sites

This is a backup you need. CAP file header is used only for signature verification, not a single byte from it comes to SPI flash, and all dumps from boards for Intel CPUs will be of "Intel image" type in UEFITool. 

  • Like 1
Link to comment
Share on other sites

MSI Z87 MPOWER

Intel i5-4670K

 

I'm trying to patch an MSI BIOS image, but the MSI BIOS download packs the image into an executable which I can't unpack on my Mac or PC. Attempting to patch the image itself (extension .1A0 renamed to .bin) spits out "paresSection: PE32 image with invalid DOS signature). I tried to use the /writeromfile command on two PCs with no success. (My PC gives me the 64bit vs. 32 bit error, and my old PC crashes command prompt. )

 

BIOS image attached.

 

Suggestions?

7818v1A.zip

Link to comment
Share on other sites

That .1A0 file is not an executable, but a normal BIOS image. The source of "PE32 image with invalid DOS signature" messages are a bunch of files with graphichs packed into files with a wrong section type (10h instead of 01h), this is an MSI bug but I doesn't affect image's integrity.

Suggestion: use UEFIPatch as usual, don't look at this messages.

Link to comment
Share on other sites

That .1A0 file is not an executable, but a normal BIOS image. The source of "PE32 image with invalid DOS signature" messages are a bunch of files with graphichs packed into files with a wrong section type (10h instead of 01h), this is an MSI bug but I doesn't affect image's integrity.

Suggestion: use UEFIPatch as usual, don't look at this messages.

 

Great to hear! However, I still don't get an output file, whether I'm using the UEFIpatch or UEFItool. On mac, I get nothing. On PC, in terminal, I get "Usage: UEFIPatch image_file" and "Patches will be read from patches.txt", but  no output anywhere. 

 

Obviously I am very new at this so I appreciate your help, you're the man!

Forget I said anything, I just tried it again and it worked great! Re-downloaded everything fresh, dropped everything in one folder and dragged the .1A0 onto the patch, and it worked this time. Thank you!

Link to comment
Share on other sites

Can I ask what the purpose of patching bios is please? What are you trying to achieve? No need for Clover or another reason?

In this specific case it's' for to avoid the use AppleIntelCpuPowerManagement kext during Hackintosh installation, as CodeRush say ptaching particular bit in particular GUID we can unlock MSR bit so you dont get KP without AppleCpu kext.

Another purpose is to update internal driver like Video, sata, network, or to replace PNG image with another,for our purpose it's mandatory to add Ozmosis stuff into bios.

Ozmosis it's a uefi software that allow you install OsX without use bootloader like clover or chameleon, it's' not for all because need some skills to perform the rigth step.

  • Like 1
Link to comment
Share on other sites

Hi CodeRush !

I'm planning to sell my HP ProBook 4540s because it don't allow me to patch and add Ozmosis files into it's RSA signed Bios, to buy an ASUS S56CM-DH51-CA. Do you think that i can do it with this laptop? I have already downloaded it's bios to know before i make a buy and it have an Aptio Capsule signature. UEFIPatch 0.3.4 shows me Patches will be read from Patches.txt that's all and UEFITool 0.20.4 shows me Aptio Capsule Signature may become invalid after image modification. Please any suggestion? Thank's in advance.

Link to comment
Share on other sites

Hi ammoune, with uefitool you have to extract body from signed bios, and make patching in this,after you can reflash back with afu for dos or for windows,or,hard way,buy a spi flasher with clips for soic chip,read bios from chip,modify,flash back

  • Like 1
Link to comment
Share on other sites

@ammoune78, the best way to get around this is using SPI flasher with SOIC clip, but it can also be flashed using (non-latest) version of AFU wuth /GAN switch using dump/patch/flash approach. I can't say that it will work for sure, but you can try it.

  • Like 1
Link to comment
Share on other sites

Excuses me! I'm extremly noob in what you say or i don't know but in same time if i understand, first way to try is flashing using SPI FLASHER with soic and the second way is flashing using AFU wuth /GAN switch using dump/patch/flash.

But the first one is the best way!

The first one need some charge, and i don't know how to do it! I think i will do it with the secong one, then if it doesn't work, i will go for the first one but mayby it will take me much time between understanding and doing!

Thank's for your delicious reply and i will report when i try it!

Link to comment
Share on other sites

Excuses me! I'm extremly noob in what you say or i don't know but in same time if i understand, first way to try is flashing using SPI FLASHER with soic and the second way is flashing using AFU wuth /GAN switch using dump/patch/flash.

But the first one is the best way!

The first one need some charge, and i don't know how to do it! I think i will do it with the secong one, then if it doesn't work, i will go for the first one but mayby it will take me much time between understanding and doing!

Thank's for your delicious reply and i will report when i try it!

Trust me friend, using Spi flasher it's' very simple for our purpose, you need only put clips in rigth way ( small dot on the chip indicate pin number one ), connect spi flasher to pc,run software, try autodetect of chip type and size,press read to read contents of chip, save in safety place, erase chip and program chip.

Spi flasher fo our purpose it's cheap almost 30€ 

If you want to know spi type, write me and i show you howto work ;-) 

  • Like 1
Link to comment
Share on other sites

Trust me friend, using Spi flasher it's' very simple for our purpose, you need only put clips in rigth way ( small dot on the chip indicate pin number one ), connect spi flasher to pc,run software, try autodetect of chip type and size,press read to read contents of chip, save in safety place, erase chip and program chip.

Spi flasher fo our purpose it's cheap almost 30€ 

If you want to know spi type, write me and i show you howto work ;-) 

 

Thank's Aigors, really thit BootLoader makes me crazy, but have you forgot my pasta? 

I will wait for a time before make a serious decision, because the Laptops are more difficults than the PCs!  :(  :yes:  :D

Link to comment
Share on other sites

Hi friend, know it's' hard put ozmosis into bios in laptop, i was in trying many months a go and i discover how hard is it because laptop don't have bios so easily removable and in few cases i had to desolder bios chip to try to modify, clips sometimes it's not enough

Link to comment
Share on other sites

Hi Aigors!

Yes, i decided to leave this laptop with clover in easiest way. Maybe in the future if i purchase UEFI Gigabyte Mobo i will try Ozmosis on it like i was with the Z87X-UD4H. Thank you and CodeRush for this beautiful knowledge. :yes:  ^_^

  • Like 1
Link to comment
Share on other sites

I am pulling my hair out trying to figure this out and if someone could point me in the right direction it might add some years back to my life. I am trying to patch BIOS for Intel DQ77KB. I know that it is confirmed, from post #9 on this thread. I am unclear how it is done with UEFIPatch. I assume that it is the same steps as with PMPatch, add UEFIPatch to terminal, then the BIOS file twice, add "patched" after the second file and hit enter. When I do this, I get the message "Patches will be read from patches.txt file", but I can't find a patched file anywhere. 

 

I have tried to do this with a version of PMPatch, but get the message "Illegal instructions: 4", I understand that this is due to the version of PMPatch that I am using. If someone can explain what I am doing wrong using UEFIPatch, or has a link to a version of PMPatch that will output a patched BIOS (0.5.11 I believe works) I would greatly appreciate it. I seem to be reading the same link over and over and not making any headway, so I don't know what I am missing. Thanks. 

Link to comment
Share on other sites

href="https://www.insanelymac.com/uploads/monthly_12_2014/post-1111314-0-85713400-1419879135.png">

 

 

C:\Users\CodeRush\Desktop>UEFIPatch.exe
UEFIPatch 0.3.4 - UEFI image file patching utility
Usage: UEFIPatch image_file
Patches will be read from patches.txt file

Second parameter is not needed for UEFIPatch, this enables drag-n-drop patching under Windows:
post-1111314-0-85713400-1419879135_thumb
  • Like 1
Link to comment
Share on other sites

Is there no drag-n-drop function then under OSX? Should I just try to patch on via Windows?

Under Osx it's enough run command like CodeRush show you 

Link to comment
Share on other sites

Hello Coderush,

 

Thank you for all that you do for this community. I have used your PM fix long ago for one of my old builds. 

 

I have a questions that is no doubt ignorant, but I hope you can answer it for me  ;) I apologize if this is off-topic, not sure where to post this.

 

 

Those of us with X99 motherboards have a memory map that does not leave enough space for UEFI Clover to load the proper kernelcache, which leads to a boot error. Would any of your tools allow me to modify my memorymap?

 

What I hope is that it is possible to clear up more space by relocating a small BS_Code to a different available address. The address I want to relocate is: BS_Code    0000000010000000-000000001000AFFF to anywhere in the 0000000000000000-000000000003EFFF range instead.

 

Questions:

1. Is it possible to modify the BIOS in such a way to alter the memmap?

2. Can you help me do it, if so?

3. Is there another way around this problem that you can think of?

 

Thank you!

 

 

I have attached my memmap and memdump from shell.

 

Thread with the problem several of us have, Dmazar's response: http://www.insanelymac.com/forum/topic/304479-possible-solutionx99-osxaptiofixdrv-requested-memory-exceeds-our-allocated-relocation-block/page-3

 

 

memmap.txt

dmem.txt

Link to comment
Share on other sites

I followed the instructions above exactly and I'm not getting an output file. In OSX I cannot drag and drop the BIOS file onto the Unix executable file, and in Windows a command window flashes for a fraction of a second, then disappears, and no output file is generated. 


So I don't know exactly what I did, but I finally got it to output a file and it is called "patched" so thanks CodeRush and Aigors for the help, appreciate it. 

Link to comment
Share on other sites

I am trying to patch BIOS for Intel DQ77KB. 

 

Is it a .BIO file or a SPI flash dump. If first, you can patch it but it can't be flashed back because of RSA signature that breaks with the patch.

The only reliable way to patch Intel BIOS is to dump it using hardware SPI programmer, patch the dump and flash it back.

Link to comment
Share on other sites

hello guys
I'm going crazy !!!!

I have a Azrock Z87 extreme 6
I would put maverick
I put maverick on usb
but continuous reboot

if I understand it I have to patch the bios

but I can not figure out how to do it !!!!

help !!!!

 

thankyou

Link to comment
Share on other sites

  • 4 weeks later...

Hi Code Rush,

 

I am trying to run the below command using UEFIPatch.EXE.

UEFIPatch.exe N5110_UEFI.rom 899407D7-99FE-43D8-9A21-79EC328CAC21 010100010101000000000000 010100010101010101010101

After i run this command i get a message 
C:\Users\santhosh.arulvanan\Desktop\BIOS>UEFIPatch.exe N5110_UEFI.rom 899407D7-9
9FE-43D8-9A21-79EC328CAC21 010100010101000000000000 010100010101010101010101
UEFIPatch 0.2.1 - UEFI image file patching utility

Usage: UEFIPatch image_file

Patches will be read from patches.txt file


Can you please help me with the method to run successfully the patch.?

Thanks in advance for your support.

 

 

Edit: 

After doing some research i see we need to add a line in patches.txt

 

899407D7-99FE-43D8-9A21-79EC328CAC21 10 P:010100010101000000000000:010100010101010101010101 

Can you please confirm if i need to use P(pattern based patch type) or O:(Offset based patch type).

Link to comment
Share on other sites

×
×
  • Create New...