Page 1 of 64
#1 [Guide] How to flash a modded AMI UEFI BIOS by Fernando 11.07.2014 00:56

avatar

Since SoniX has presented his wonderful UBU tool (look >here<) it has become very easy to modify any UEFI mode mainboard BIOS regarding their included Option ROM and EFI modules. Unfortunately the real risky part of the BIOS modding operation begins, when the user is going to flash the modded BIOS into the BIOS chip of the mainboard.

Although I only have own experience with ASUS and ASRock mainboards, I decided to write this guide about how to get the modded BIOS properly flashed and working without getting an error message. It would be great, if a user of a Gigabyte or MSI mainboard would write a similar guide.

General warnings/advices:

  1. Warning:
    Before you are going to flash any modded BIOS into any mainboard BIOS chip, you have to make sure, that the source BIOS version definitively has been designed exactly for this mainboard type (incl. Revision number)!

    Flashing a wrong (not matching) BIOS may cause a bricked BIOS chip and an unusable mainboard.
  2. General advices:
    • How to name the BIOS file?
      Usually it is a good idea to give the modded BIOS file the exactly same name (incl. extension) as the original BIOS file (there are some exceptions, see below).
    • Which flash procedure resp. which tool should be used?
      The most risky flashing procedure is the one from within a running OS. That is why I recommend to use either a BIOS flash tool from within the UEFI BIOS or a flash tool, which has been put onto a bootable USB Flash Drive with a DOS environment.
      A very safe method to get a modded BIOS properly flashed is to use the "normal" BIOS flashing tool the mainboard manufacturer is offering within the BIOS. The problem is, that the tool may detect the alteration of the BIOS and refuses to flash it.
      The Company AMI itself offers >here< for their different BIOS platforms (AMIBIOS, Aptio IV and Aptio V) specific BIOS Update Utilities. They are as well available within my OneDrive account (look >here<).
      Another tool, which is able to flash a modded BIOS into the BIOS chip of Intel Chipset mainboards is the "Flash Programming Tool (FPT)", which is part of the related Intel (CS)ME System Tools version. You can find the specific Intel CSME System Tools for your mainboard within the chapter C2 of >this< start post.
    • What can be done, when the "Flash Programming Tool (FPT)" gives an error message due to the BIOS's WRITE protection?
      Our BIOS Gurus SoniX and Lost_N_BIOS have written guides about how to solve this problem by using different methods. These guides can be found >here< (SoniX's Guide) and >here< (Lost_N_BIOS's Guide).



Guide for ASUS mainboards
with an AMI UEFI BIOS


Flashing an ASUS BIOS file with the extension ".ROM"
This BIOS file type is not capsuled and usually not write protected. It is most common for ASUS P67 and Z68 mainboards.
That is why it should be no problem to get an accurately modded BIOS flashed into the BIOS chip by using the ASUS standard tool named "EZ Flash".

Flashing an ASUS BIOS file with the extension ".CAP"
These types of ASUS BIOS files are capsuled and write protected, which makes it impossible to flash a modded .CAP BIOS the usual way.
There are at least 3 options how to solve this problem:
  • A. Using the ASUS "USB Flashback" procedure (easiest option)
    Many ASUS mainboards with an Intel 7- 8- or 9-Series chipset do support this very easy to use feature to get a modded BIOS flashed. These boards have a special "Flashback USB port" and a special "USB Flashback button". For details please look into your mainboard manual or at >this< ASUS site (maybe the Smart Redirect Addon has to be disabled).
    Procedure:
    1. Rename the modded BIOS file according to ASUS "USB BIOS Flashback Rules". The ASUS support is offering a tool named "BIOS Renamer for USB BIOS Flashback" for all mainboards, which support the USB Flashback feature. Furthermore the UBU tool offfers the renaming procedure as well.
    2. Copy the modded and renamed BIOS file onto a small sized, freshly FAT32 formatted USB 2.0 Flash drive and insert it into the special "USB Flashback port" (Note: The USB Flashback mechanism is very picky regarding the used USB Flash Drive. So if the procedure should fail, try another USB stick!).
    3. Shut down the computer, but don't power it off.
    4. Hit the USB BIOS Flashback button. A LED light will start blinking. Press the button for some seconds (LED light should have blinked 3-4 times).
    5. Wait until the LED light doesn't blink anymore. This means, that the BIOS has been successfully flashed into the BIOS chip of the mainboard.
    6. Then all is done. You can power off the computer and remove the USB Flash drive.
  • B. Methods for ASUS mainboards without USB Flashback support
    • Using the AMI tool AFUWIN:
      • Download the appropriate AFU tool from the AMI websites. The download link to the "AMIBIOS and Aptio AMI Firmware Update Utility" can be found >here<.
        Attention: The " /GAN" command suffix is not supported by the latest AMI AFU Tools!
        Users, who are running a 64bit Windows OS and want to flash a modded AMI Aptio IV BIOS, can download the AFUWIN64 tool v3.05.04 from >here<.
      • Follow this easy, but obviously often successful trick to circumvent the ASUS BIOS protection (published >here< by ValkyrieStar and >here< by OldGuy):
        1. Copy the original (untouched) BIOS file into the same directory as the file AFUWINx64.exe.
        2. Flash the original BIOS by running the following Command Prompt (as Admin):

          1
           
          afuwinx64.exe <NAME OF THE ORIGINAL BIOS>.CAP
           

        3. Remove the capsule header from the modded *.CAP BIOS file and save the modded BIOS as *.ROM file.
          The removal of the capsule header can be done by several BIOS tools. Here is the way how to do it by using the latest UEFITool version (you can get it from >here<):
          • Open the *.CAP file, do a right-click onto the listed "AMI Aptio capsule", choose the option "Extract body..." and save it as *.ROM file. Here is the related screenshot:

            Note: Due to the removed capsule header the *.ROM file is a little bit smaller sized than the original *.CAP file. This is normal and nothing to worry about.
        4. Replace the original *.CAP BIOS file within the AFUWIN64 folder by the modded *.ROM BIOS file .
        5. Flash the modded BIOS by running the following Command Prompt as Admin:

          1
           
          afuwinx64.exe <NAME OF THE MODDED BIOS>.ROM /GAN
           

        6. The UEFI BIOS should now be fully re-flashed and updated! Reboot and give it a try!
    • Using the ASUS AI Suite
      Our Forum member Wishbringer reported, that he was able to successfully flash modded *.CAP BIOSes into the BIOS chip of several Intel 7-, 8- and 9-Series Chipset ASUS mainboards by doing the following:
      1. Download AI-Suite (when not for Win10 available use Version for 8.1)
      2. Start Easy Update for BIOS Update in Windows, select ORIGINAL file (then some timeconsuming checking seems to happen)
      3. Before start flashing delete selected original file and replace with modded one (same name, same location).
      4. Proceed with bios flash.
      For details please look into >this< post. Big thanks to him!
    • Using the Flashrom tool: (recommended for 32MB sized BIOSes of AMD chipset mainboards)
      You can find a guide about its usage within the Annex part of this post.
      Although I have own experience only with the BIOS of my ASRock X570 Pro4, I am very confident, that the method will work with modern ASUS X570 chipset mainboards as well.



Guide for ASRock mainboards
with an AMI Aptio UEFI BIOS


General information about flashing an ASRock BIOS file
The normal procedure to flash an AMI UEFI BIOS into the BIOS chip of an ASRock mainboard is to copy the BIOS onto a FAT32 formatted USB Flash drive, to enter the BIOS, to navigate to the "Tools" section and to choose the "Instant Flash" option. Some BIOSes of older ASRock mainboards can be flashed this way even after having modded it, but all modern ASRock UEFI BIOSes have an internal "Security Flash Check", which may prevent a successful flashing of any modded BIOS (unless the user is able to circumvent the protection).
Unfortunately the "Instant Flash" tool cannot be used at all with modded 32MB sized ASRock BIOSes (see below).


Flashing a modded ASRock UEFI BIOS by using the ASRock BIOS tool "Instant Flash"
(valid for all 8MB or 16MB sized ASRock mainboards with an AMI Aptio UEFI BIOS)


The "Security Flash Check" of ASRock mainboard UEFI BIOSes is located either within the BIOS capsule header (valid for AMI Aptio IV BIOSes) or at a specific place outside of it (valid for all AMI Aptio V BIOSes).
Users of an ASRock mainboard, who are trying to flash a modded, but still protected UEFI BIOS may get an error message like this:
[[File:Instant Flash failure.png|none|auto]]
Thanks to
a) our BIOS Guru lordkag, who detected the exact position of the related code of ASRock AMI Aptio V BIOSes, and
b) our UBU maker SoniX, who included the automatic removal of the ASRock security flash check as an additional UBU tool feature,
it is very easy to circumvent ASRock's BIOS protection and to get a modded ASRock AMI Aptio UEFI BIOS properly flashed.

Solution:
The "Security Flash Check" hex code can be deleted from the ASRock UEFI BIOS without any impact on the integrity or functionality of the BIOS. This can be done either by the user as a separate BIOS modification process or automaticly by the UBU tool (new feature even for a lot of Aptio V BIOSes since UBU v1.50).
Here is a short guide for UBU newbies:
  1. Download the latest UBU tool (you can get it >here<) and unzip it by using WinRAR v5.xx or 7-zip v20.00.
  2. Run the UBU.bat, navigate to your modded ASRock BIOS file (should be named as the original one) and double-click onto it.
  3. After having completed the BIOS scanning by the UBU tool, hit any key and then enter "0" (for Exit) to get access to the UBU Main Menu.
  4. Provided, that you don't want to get any BIOS module updated, enter "0" (for Exit) again.
  5. As last step you will be asked by the UBU tool how the BIOS file should be stored.
    If you want the ASRock "Security Flash Check" code being removed from the BIOS, you should choose the option "1".
  6. After having hit any key, you will find the modded BIOS, but now without the "Security Flash Check", within the UBU folder.
    You can easily verify, whether the UBU tool has removed the "Security Flash Check" or not, by comparing the size of the modded and the original BIOS. If the modded BIOS is a few KB smaller sized than the original one, you can be sure,
    a) that the original BIOS contained ASRock's "Security Flash Check" and
    b) that the UBU tool found it and was able to removed it (not possible with BIOSes of the newest ASRock mainboards).
    Don't worry about the BIOS file size difference. Since the size of the modded BIOS Region is still identical with the original one, the modded BIOS will be successfully flashed despite the size difference of the complete BIOS file.
  7. Flash it from within the BIOS by using the ASRock "Instant Flash" tool.
  8. At the end of the flashing procedure you should get this success message:
    [[File:Instant Flash Success.png|none|auto]]


Flashing a modded ASRock UEFI BIOS by using the BIOS tool named "Flashrom"
(only useful for the latest ASRock mainboards with a 32MB sized AMI AptioV UEFI BIOS)
You can find a guide about the usage of the Flashrom tool within the Annex part of this post.


Guide for Gigabyte mainboards
with an AMI Aptio UEFI BIOS


Usually it is no problem to get a modded AMI Aptio BIOS properly flashed into the BIOS chip of a Gigabyte mainboard by using the Q-Flash utility.
Tip: You should give the modded BIOS the exactly same name as the original BIOS (incl. its extension).

If you should get an "Invalid BIOS Image", please have a look into >this< thread. Within the start post you will find lordkag's brilliant instructions and >here< a step-by-step guide written by rootuser123 about how to circumvent the "Invalid BIOS Image" message and to get a modded Gigabyte Z170 mainboard BIOS properly flashed.
Tip from our Forum member rootuser 123: Users of a newer Gigabyte motherboard with an EFIFlash.exe file in the BIOS zip file can use the modded efiflash, which has been attached >here< by our Forum member Mov AX, 0xDEAD. The related report from rootuser123 can be found >here<.
In case of any problems while trying to flash a modded Gigabyte BIOS please post your help request >here<.

Another option to get a modded Gigabyte BIOS properly flashed is the usage of the EFIFlash v0.80 tool. For details please look into >this< thread.


Guide for Supermicro mainboards
with an AMI Aptio UEFI BIOS


You can find a guide written by our Forum member Wishbringer within >this< post. Big thanks to him!



Annex:
How to dump the BIOS Region and to flash a modded AMI UEFI BIOS
by using the Flashrom tool

(valid for mainboards from all manufacturers)


Flashrom is a utility for identifying, reading, writing, verifying and erasing flash chips. It is designed to flash BIOS/EFI/coreboot/firmware/optionROM images on mainboards, network/graphics/storage controller cards, and various other programmer devices. >Here< is the link to the official website.
After having successfully tested this tool with my new ASRock X570 Pro4 mainboard, I can really recommend its usage for mainboards with a 32MB sized AMI UEFI BIOS (it may work with other AMI UEFI BIOSes as well).
A big advantage of this tool is the any-time option to reflash the previously working backuped BIOS Region, if anything should not work properly after having flashed an updated or modified BIOS.

Here is a short guide about how to use this tool:
  1. Download and unzip the attached package named "Flashrom v1.2 Utilities", which contains all required tools and files.
  2. Run any Windows OS, insert a 2-8 GB sized USB Flash Drive, do a quick FAT32 formatting and give the drive a meaningful name like "FLASHROM".
  3. Create a bootable USB Flash Drive with a FREEDOS image by using the tool Rufus, which is within the "Flashrom Utilities" package.
    Here is a screenshot about the most important Rufus settings:
    [[File:Rufus Settings for Flashrom Usage.png|none|auto]]
  4. Copy the Flashrom files named flashrom.exe and CWSDPMI.EXE into the root of the just created bootable USB Flash Drive.
  5. Boot off the USB Flash Drive in LEGACY mode (CSM should be set within the mainboard BIOS to "ENABLED").
  6. Once you have access to the DOS image, type "flashrom -p internal -r BACKUP.ROM", hit the "Enter" key and wait until the process has been finished.
    You hopefully will see something like this on your desktop screen:

    Now you can shut down your PC and remove the USB Flash Drive. Don't forget to enter the BIOS during the next start of the PC and to restore your desired BOOT order and options.
  7. The just created file named BACKUP.ROM is a clean complete BIOS Region dump of your mainboard and should be stored outside of your PC to be able to recover the original BIOS Region later on, if something should go wrong at any time.
  8. Now you should use a copy of the backup.rom file as source for the UBU work updating the desired BIOS modules.
  9. Once you have finished the desired UBU processing and saved the product as "mod_BACKUP.ROM", rename it to "MOD.ROM" and copy it onto the already previously used USB Flash Drive.
  10. Boot off the USB Flash Drive in LEGACY mode again, type "flashrom -p internal -w MOD.ROM", hit the "Enter" key and wait until the erasing, flashing and verification process has been finished.
    Users, who want to get a logfile about what exactly has been checked, detected and done by the tool, should execute the command with the suffix " -o writelog.txt" (thanks to hancor for the info).
    Here is the picture you hopefully will get:
    [[File:Flashing modded BIOS by Flashrom.png|none|auto]]
    Then you can shut down your PC and remove the USB Flash Drive.
  11. Start the PC, enter the BIOS, set everything to "DEFAULT" and restore your specific non-DEFAULT BIOS settings.
  12. After the reboot your mainboard is using the updated BIOS.
If you want to know more about the exact procedure, please go >here<, where our Forum member aGeoM is offering some videos about the usage of the Flashrom Utilities. Additional information about the Flashrom tool can be gotten on >this< Wikipedia page.
All credits regarding the usage of the Flashrom tool go to its makers, to "The Stilt" at overclock.net (>LINK<) and to our Forum member aGeoM for his admirable work to make the related videos and to pursuade me to do the required tests.


Disclaimer:
The BIOS modification itself is not risky at all, but flashing a modded BIOS may end with an unbootable system or even with a bricked mainboard/PC.
Neither the maker of the used BIOS Flashing tool nor the author of this guide will overtake any responsability, if anything should go wrong.
Everything needs to be done by people, who
a) understand, what they are doing, and
b) know, that they alone are responsable for their action.


Good luck!
Dieter (alias Fernando)

#2 RE: [Guide] How to flash a modded ASUS or ASRock UEFI BIOS by CodeRush 11.07.2014 01:56

avatar

This HxD method can be bad because capsule header is not always have size of 0x1000, it can be 0x50, 0x800, 0x1000 and 0x2000 (and other values theoretically, but I didn't saw them).
To properly remove CAP file header, open the file with UEFITool, select "AMI Aptio capsule" (root element of items tree), press right mouse button, select "Extract body..." and save the result.

#3 RE: [Guide] How to flash a modded ASUS or ASRock UEFI BIOS by Fernando 11.07.2014 14:42

avatar

@ CodeRush:

Thanks for your comment. I didn't kow, that the ASRock BIOS capsule header may have different sizes.
As a consequence I have written a new guide by using your "UEFITool", hoping that it is ok for you and easy to understand for the users.
Additional question:
What do you think about a direct download link to your currently latest UEFITool version within the start post of this thread?
The problem will be to keep the mirror link up-to-date. Maybe you can give me an info or just post here, when you have released a new UEFITool version.

#4 RE: [Guide] How to flash a modded ASUS or ASRock UEFI BIOS by CodeRush 11.07.2014 20:43

avatar

@Fernando, you can link it directly, if you wish.
Why so complex way to run UEFITool? There are nothing that required admin rights and BIOS file can be opened by dragging it onto UEFITool.exe file, so the first half can be simplified.

#5 RE: [Guide] How to flash a modded ASUS or ASRock UEFI BIOS by Fernando 11.07.2014 23:15

avatar

Zitat von CodeRush im Beitrag #4
@Fernando, you can link it directly, if you wish.
Thanks, I will do it.

Zitat
Why so complex way to run UEFITool? There are nothing that required admin rights and BIOS file can be opened by dragging it onto UEFITool.exe file, so the first half can be simplified.

I will think about a simplification. On the other hand you should keep in mind, that I write my guides for newbees, who want to know step by step what they have to do.

#6 RE: [Guide] How to flash a modded ASUS or ASRock UEFI BIOS by MartiniGM 16.07.2014 16:27

avatar

I have trouble doing USB flashing modded bioses if my P8Z77-V Pro is running a newer bios than 1805. Asus added some kind of verification to prevent flashing non ASUS-bioses in versions newer than 18xx

So I have to downgrade to 1805 (using USB flash) and after 1805 is flashed, flashing a newer modded bios is possible.

Or is this procedure not really necessary??

#7 RE: [Guide] How to flash a modded ASUS or ASRock UEFI BIOS by Fernando 16.07.2014 16:44

avatar

@ MartiniGM:
Welcome at Win-RAID Forum!

Zitat von MartiniGM im Beitrag #6
I have trouble doing USB flashing modded bioses if my P8Z77-V Pro is running a newer bios than 1805.
I have never had a problem to flash a modded v2104 BIOS into the BIOS chip of my ASUS P8Z77-V, when I used the USB Flashback method.

Zitat
Asus added some kind of verification to prevent flashing non ASUS-bioses in versions newer than 18xx

The USB Flashback method should work nevertheless.

Zitat
So I have to downgrade to 1805 (using USB flash) and after 1805 is flashed, flashing a newer modded bios is possible.
Or is this procedure not really necessary??

I don't think, that this is necessary.
Questions:
1. How did you try to flash your modded BIOS?
2. What has been updated/modified within the BIOS?

Regards
Fernando

#8 RE: [Guide] How to flash a modded ASUS or ASRock UEFI BIOS by HJALMAR 18.07.2014 03:55

avatar

Is there a BIOS for Asrock Z68 Pro 3 NON- M in the interwebs that has TRIM enabled RAID0? If so where to get it and will the guide work for it?
I'm sorry to be rude and demand help here but I'm in a hurry and searched everywhere and have not found anything for my board.

HJALMAR

#9 RE: [Guide] How to flash a modded ASUS or ASRock UEFI BIOS by Fernando 18.07.2014 10:13

avatar

@ HJALMAR:
Welcome at Win-RAID Forum!

Zitat von HJALMAR im Beitrag #8
Is there a BIOS for Asrock Z68 Pro 3 NON- M in the interwebs that has TRIM enabled RAID0? If so where to get it and will the guide work for it?
None of the original BIOSes for 6-Series chipset mainboards natively does support the TRIM in RAID0 feature, because all mainboard manufacturers insert just the original Intel RAID ROM modules and they do not support this feature for 6-Series chipset RAID0 systems.

Nevertheless you are able to get TRIM working within your Z68 RAID0 system, when you insert a "Universally TRIM modified" Intel RAID ROM version (look >here<) into the BIOS. You can do it manually by using >this< guide or let it be done by the UBU tool according >these< instructions.
EDIT:
I just have seen >here<, that you found already someone, who has done the BIOS modding for you.

Before you are going to flash the modded BIOS, you should prepare it according to my guide (= start post of this thread).
EDIT:
I just have realized, that your BIOS is not capsuled. So you should be able to flash the modded BIOS without any problem.
Zitat von HJALMAR im Beitrag #8
I'm sorry to be rude and demand help here but I'm in a hurry...
To be in a hurry is no reason to be rude, especially not, if you want help.

Regards
Fernando

#10 RE: [Guide] How to flash a modded ASUS or ASRock UEFI BIOS by HJALMAR 21.07.2014 01:40

avatar

Thank you so much for the help, and again sorry. Guess I tried to be polite and rude at the same time. But thanks again my BIOS is all sorted and works like a charm.

#11 RE: [Guide] How to flash a modded ASUS or ASRock UEFI BIOS by lgrootnoob 27.08.2014 16:21

You know how we dont have usb flashback on our p8b** boards?
well maybe this code which contains the ami uefi signing keys/system could help.
EDIT by Fernando: Thepiratebay link removed
what do you think guys?
or could you help me do one of those hardware programmers things?

#12 RE: [Guide] How to flash a modded ASUS or ASRock UEFI BIOS by Fernando 27.08.2014 16:40

avatar

@ lgrootnoob:
Welcome at Win-RAID Forum!
<blockquote><font size="1">Zitat von <a class="nopad" href="u1565_lgrootnoob.html" style="color:">lgrootnoob</a> im Beitrag <a class="nopad" href="t154f16-Tool-quot-UEFI-BIOS-Updater-quot-UBU-58.html#msg8106">#878</a>


You know how we dont have usb flashback on our p8b** boards?
well maybe this code which contains the ami uefi signing keys/system could help.[/quote]Since we do not want to offer illegal software, I have removed your link to "ThePirateBay".
<blockquote><font size="1">Zitat
or could you help me do one of those hardware programmers things?[/quote]You can find [Guide] Flashing modified AMI Aptio UEFI using AFU a guide how to get a modded AMI UEFI BIOS successfully flashed into the BIOS chip of ASUS mainboards without the USB FlashBack feature.

Regards
Fernando

#13 RE: [Guide] How to flash a modded ASUS or ASRock UEFI BIOS by lgrootnoob 27.08.2014 19:47

Thank you for the link, i will try it tonight.
Sorry for the link, i didnt realize that wasnt allowed here.
I wont do it again.

#14 RE: [Guide] How to flash a modded ASUS or ASRock UEFI BIOS by lgrootnoob 28.08.2014 23:25

i tried it out.
afudos on the p8b75mcsm and it didnt work.
when i flash with /gan and reboot it turns on, then off and does normal post. then i pull the bios and sue ubu to see if the modules are updated. and no, its the same modules but the md5sum is different from the original rom.
p b k doesnt flash cause it cant get secure flash perms or whatever.
i even removed the .cap header with uefitool.
and winsce64 crashes when i try to flash the nvram
I have a raspberry pi so im gonna try spi.
is this the spi header? https://imgur.com/A5og80Nthe gold dots?

#15 RE: [Guide] How to flash a modded ASUS or ASRock UEFI BIOS by Darkdead 15.01.2015 19:16

Ty for the post this works to for flash whit external programers because the rom whit the header exceed the size of the serial flash chip and programers like ezp2010 say file to large.

Xobor Forum Software von Xobor
Datenschutz