[Guide] How to flash a modded AMI UEFI BIOS

@Fernando

If you set the command:

1
 
afuwinx64 /?
 

Does such a keya /ATR appear in the Options list?

@SoniX :
Yes, it does, but it obviously doesn’t help.
After having executed the command “afuwinx64 backup.rom /O /ATR” I got a 16MB sized backup.rom file again.
Here is the list of the command options and suffixes, which are shown by the currently latest AFUWINx64 tool v5.12.03.2074:

AFUWINx64 Options.png

@Fernando

This Option is only for writing data to the chip.
But without the means of full recovery, can’t check how it works. What and where to write to the chip if use a 32MB file

By the way, I remember that you already tried to flash BIOS using the AFU, but I can not find your message about it.

@SoniX :
Until now I have only tried to flash a modded BIOS onto my new ASRock X570 chipset system by using the BIOS own “Instant Flash” option. Result: It always failed.
Since this is the PC I am working with, I didn’t want to risk a broken mainboard by using an absolutely uncertain procedure.

@aGeoM :
Hi Paulo,
your recent advices regarding the usage of the flashrom tool are very interesting and promising for me.
It would be fine, if you would take the time and post

  1. the links to the source files/utilities, which are required for the “Flashrom” method and
  2. a short step-by-step guide about the usage of the related tools, especially
    • how to get the complete BIOS Region dumped and
    • how to get a modded BIOS properly flashed into the SPI chip of modern AMD chipset systems without any “USB Flashback” feature.

Thanks in advance!
Dieter (alias Fernando)

@Fernado

Hello Dieter
No problem:

1- Links: Flashrom Wiki; @TheStilt’s original post @OCN
2-

2.1- Preparing USB stick:


2.2- Dumping BIOS


2.3- Modding BIOS


2.4- Flashing Modded BIOS

EDIT:
Uploading files.

Ok it is done, was my first video demonstration, hope this will help you and others, credits go to @The Stilt and all guys evolved in Rufus + Flashrom development.

@aGeoM :
Thank you very much for this phantastic tutorial. That helps a lot!
As soon as I have the required time, I will test it with my X570 chipset system.
Can you please attach the diskcopy.dll file, which is usable with Win10 x64 v2004?

Yes, sure.

diskcopy.zip (574 KB)

@aGeoM :
With your help I just have successfully dumped the complete 32.768 KB sized BIOS Region of my mainboard’s SPI chip - thanks!

@aGeoM :

That is why I am still unsure whether I should flash the UBU modded BIOS by using the Flashrom tool. How can I avoid any negative impact on the hidden BIOS entries (MAC address, SN etc.)?
On the other hand I have now the complete dump of my mainboard’s specific BIOS Region, which contains all these secret personal data. If I use a copy of this dumped BIOS Region as source for the UBU work and flash it by using the Flashrom tool, the personal data should be completely restored after the erasure of the BIOS Region.
What is your opinion?

@Fernado

You should be fine, if you use the dumped BIOS, I had put to my self the same question when I did the video demonstration before click "enter" for flash procedure, but I have an backup data of my system, and can be inserted on ASUS BIOSES with FD44Editor, so it was an calculated risk. Now I am sure that the data is also programmed since it is on dumped BIOS.

A side note: When I did the mod I (Part 3) I used AMIBCP tool on dumped BIOS without spiting it is because I am on Ryzen Zen+ (2700X) and BCP only edits the first 16MB, so if you or someone reading have a Zen2 CPU it is necessary to split the BIOS and edit the second half, then combine every thing for flashing.

Edit:

On ASUS BIOSES It is possible to find and edit/replace by text searching ASUSBKP$.

@aGeoM :
Today I was brave enough to risk a bricked BIOS and flashed the UBU modded BIOS into the SPI chip of my ASrock X570 Pro4 by using the Flashrom tool.
Result: Success on first try! My PC is still alive!
Here is the proof, that I really have done it:

Flashrom success.jpg


Tomorrow I will do a backup of the current (updated) BIOS by using the same tool and then compare the original and the updated BIOS.
Thanks again for your support!
Dieter

@Fernando
That is a good news, I am glad to be helpful. The doors are open to take the most of your board. Again credits goes to @TheStilt I just point it out.
Be well Dieter, and happy modding.

Paulo

@Lost_N_BIOS
Here is the dump of my BIOS from HP Z620 via FPTw utility and an error message when I tried to write the dumped bios back.
Thank you a lot.

BIOS_modding.zip (3.7 MB)

@aGeoM :
Hello Paulo,
meanwhile I have dumped the modded BIOS Region of my mainboard and was able to verify, that all BIOS modifications, which were done by the UBU tool, are now effective for my AMD X570 chipset system.
>Here< you can find my related UBU report, which I have addressed to SoniX.
As soon as I have the required time I will try to add a written guide about how to use the Flashrom method to the start post of this thread. That will be the place to give credits to the Flashrom tool makers, to The Stilt and (last but not least) to you. Without you I would never have tried to execute this interesting BIOS flashing and recovering method.
Thanks again!
Dieter

@aGeoM

It would be nice to compile latest flashrom (1.2) for DOS (like the 1.1 version). Do you know anyone being able to do it please ?

Here is the source code : https://github.com/flashrom/flashrom/releases/tag/v1.2

Furthermore the diskcopy.dll what is supposed to do ?

Personally I do not, the only new AMD chipset supported version was The Stilt 1.1 one, maybe asking him if he kindly compile a 1.2 version he will do it. I do not have any experience on compiling, only did it twice a couple years ago when I was on Mining experience, following a step by step guide.

diskcopy.dll is a .DLL file missing on Win10 to allow formatting a bootable USB stick.

Diskcopy.dll is useless if you’re planning to use Rufus, which, indeed, is able to make a proper bootable usb stick, or am I missing something ?

The @The Stilt’s version is the flashrom 1.1 compiled DOS version which supports the eeprom used on AMD chipset motherboards, I was asking (and I’ll ask also him)
for 1.2 due to a wider eeprom support than the old version (1.1).

Anyway I’ve used it on my Rampage V Extreme motherboards and it works like a charm.

Only one thing must be said : flash descriptors region must be set on eeprom to FF (read/write access to the SPI eeprom), while if bios has the "Production Flash Descriptors"
flashrom, like any other flashing tool, will not be able to dump/erase/write any info from/to SPI eeprom.

@Sylar76 :
The file diskcopy.dll is required for the creation of a bootable DOS USB stick. Look >here<.

@Rabanik - Put system to S3 sleep for one minute (be sure it’s one full minute, or more) and then wake it up and try to do the BIOS region flash back again.
If that does not work, you will need flash programmer. I can send you tool that may be able to bypass error 28, but it’s risk to brick your board too so not ideal to try unless you have programmer (in which case, no need to try it)

Or, you can do pinmod as shown at E.1 here - [Guide] Unlock Intel Flash Descriptor Read/Write Access Permissions for SPI Servicing
If you do that, do not reboot or you’ll have to do it again. After that is done, and you boot to windows, dump FD and send to me to edit, or see section B of thread above and edit your FD to unlock all regions per the second spoiler image 1 or 2, whichever matches your FD
Dump FD >> FPTw.exe -desc -d fd.bin
Write modified FD (only possible after pinmod success) >> FPTw.exe -desc -f fdmodified.bin