Flashing Gigabyte while avoiding "Invalid BIOS image"

I decided to investigate the error “Invalid BIOS image” that plagued some Gigabyte users. It turns out Gigabyte is using a structure called BiosDataRecord to perform an integrity check. It seems Gigabyte specific and it was present in older platforms as well (checked and found at Z87 and X79), just that it isn’t/wasn’t always fully activated.

Gigabyte_BDR.png



Edit: In Volume checks, the 4th block is not what I originally thought, but rather an order, always descending. And 0Dh is not necessarily equal to C0h, but could still be related to FF value in flags. Maybe C0h is a general toggle for checks. I would have to compare more samples or do an in deep disassembly. The original post was the result of a single day work.

The structure is found in GUID 56E14F88-234B-4C34-B204-299670447247. I managed to disassemble most of the content, the remaining bytes are either not invoked (i.e. not important) or not immediately invoked (again not important). What triggers the error is the Volumes check. I have compared only a few samples, but the Other checks (imd$, $GCD, $TPM) are usually empty - that is, the GUIDs defined in those fields have no usable data. I haven’t yet figured how the checksum of the volumes is obtained, but there are simpler alternatives:

- first and safest is to switch the flag for Volumes check. Based on efiflash disassembly, the check only happens when that flag is 01, or $BDR + 63h = 1. Thus it can be changed to any other value to avoid the check and error. To remain on the safe side, I suggest the use of Gigabyte values: I have seen FF or 02. The value 02 seems more appropriate, as FF was used in addition to offset 0Dh and offset C0h = 01. But I only compared like 3 samples, it could have been a coincidence. You can also zero the checksum fields, if needed.
- second and practical is to patch efiflash itself to ignore the check. The patched file is attached.

I should state the obvious, that I haven’t tested any of the above methods, neither can I offer assurance that it would go risk-free. I am just offering the theory, which required some brainstorming from my part; the practice has to come from those with the hardware and bravery to test.

Efiflash 0.62_Mod.rar (38.4 KB)

Efiflash 0.65_mod.rar (41.1 KB)

Thanks lordkag, it works on my GA-Z170-HD3 motherboard. So your modded Efiflash and Intel’s FPT tool work on my motherboard.

Just to be sure, you only tested method nr. 2, modded Efiflash? This is the better method so far, until they change efiflash to be irreversible. As a note/warning, Intel FPT should be used as a last solution, or for flashing regions that aren’t normally touched by other flashers. It just writes what you tell it to write, with no consideration for EFI variables, serials, MAC or other custom fields.

Yeah, I tried it on my motherboard and it worked perfectly.

Steps on how to flash modded BIOS on Gigabyte Skylake Motherboards:

1. Download FreeDOS ISO from here: http://www.freedos.org/download/
2. Use rufus to make a bootable FreeDOS USB: http://rufus.akeo.ie/
3. Plug in your USB and in the option “Create a bootable disk using” select FreeDOS
4. After rufus has finished making your bootable USB, put lordkag’s modded efiflash and your modded BIOS into the USB.
5. Now make the FreeDOS USB as the first bootable drive.
6. Once you get into FreeDOS, in the command prompt type in “efiflash NAMEOFBIOS.FX” without the quotations where NAMEOFBIOS.FX pertains to the name of the BIOS file.
7. Now your computer will do a power-off cycle once it finishes flashing.

Hello,
i have a motherboard Gigabyte X99 Ultra Gaming.
I have the new BIOS F4 geflashed.
With RW - Read & Write Utility v. 1.4.9 AcpiTbls.rw file made
With Phoenix/Dell/EFI SLIC Mod v2.66 (Method "Module") BIOS with SLIC 2.1 susessfully made
With rufus a bootable stick made

If i try to flash with standartd efiflash programm, i get fehler "Invalid BIOS Image"
If i try to flash with modified efiflash programm, i get fehler "OEMID mismatch"

I have tried with different Manufacturer /SLIC Files, but i get immer the same fehler.

What do i falsh? Can some one help me or give a link to another method / tool?

Thank you


I to have "OEMID Mismatch" error when flashing GA-Z97M-DS3H. Then just use integred Q-Flash and flashing done correct.

You will need a modded efiflash for your X99 motherboard. Upload the original efiflash and if lordkag has time, he might be able to make a modded efiflash.

Hello,

Please note this text is translated by a software please apologize for the possibility of a misunderstanding,
Unfortunately I’m not English.
I am new to this site I have come to ask for help.

I have a motherboard gigabyte Z170X-Gaming 3-EU “Z170” so I used the utility to modify the BIOS.
I use UBU_v1.65 version for changing the integrated Intel IRST Roma in the utility.
With the procedure described in the tutorial.
I proceed in the following way I backup my BIOS I copy in the utility,
runs the bat file administrator and change the module as shown irst stage 1.
Everything happens normally with OK at the end of process.
But when I try to flash the new BIOS I changed a mistake,
not flashing my BIOS with the same utility that integrated with the motherboard.
The utility has yet correctly for module changes
requested by the user.
Could you tell me what happens to the utility refuses to flash the bios newly amended.
Cordially.

ps:
Small special request on my motherboard BIOS I F8C gigabyte updated a F20C BIOS for new processors and some updated module.
When I try to flash my motherboard with the new bios
Official I have no automatic detection of the primary graphics card in slot 1 of the motherboard,
I have to move the HDMI on the motherboard so that the screen can turn on.
Only the GPU 530 is present in the Windows 10 64-bit device manager,
the primary graphics card disappears and is no longer usable regardless of the settings that I can activate the newly flashed bios.
I wrote gigabyte Support to report the problem with the official bios on their site for my motherboard.

Again I apologize if I have not posted in the right place.
cordially

EDIT by Fernando: Unneeded part written in french language removed (to save space), post moved into a better matching thread and post title customized

@Hominel :
Welcome at Win-RAID Forum!
Since your post has nothing to do with the UBU tool, but with the flashing of a modded Gigabyte Z170 mainboard BIOS, I have moved it into this already existing thread.

Now to your problem to get the modded BIOS properly flashed:
Please have a look into the start post of this thread and into >this< special guide written by our Forum member rootuser123.

Regarding your other BIOS problem (missing automatic detection of your inserted graphics card) we cannot help you. Only the mainboard manufacturer Gigabyte resp. their Support can solve this problem.

Good luck!

Regards
Dieter (alias Fernando)

thanks works on my GA-Z270M-HD3

It works on my Kabylake motherboard also, specifically a Gigabyte GA-Z270X-Gaming 5. As long as Gigabyte doesn’t alter efiflash on newer motherboards in the future, then this modded efiflash should work.

If "efiflash NAMEOFBIOS.FX" gives error, use /X parameter.

"efiflash NAMEOFBIOS.FX /X"

Thank you @Fernando. I’m following the steps in the 5th post but I can’t download the effiflash mod by lordkag, it says: “Dieser Link war nur eine begrenzte Zeit gültig” so I stopped at step 4th.

Can you activate the link? There is another mirror?

Thanks.

I had no problem to download the related package.
It is attached.

636fe6.rar (38.4 KB)

Thanks Fernando.

I’ve tried but the FreeDOS OS report me an error when I write the command “efiflash BIOSnvme_v2” or “efiflash BIOSnvme_v2.xf”… I tried a lot of combinations and always the same error… I attach some images.
The command “efiflash BIOSnvme_v2.xf /R” reports the same error.

Do you have any suggestion?

Thanks :slight_smile:

FreeDOS_1.jpg

FreeDOS_2.jpg

FreeDOS_3.jpg

@Mrcarl0s8 :
I have moved our recent discussion about how to get a modded Gigabyte BIOS properly flashed into this better matching thread, because it has nothing to do with the thread about how to get full NVMe support.

You should better ask users, who have already successfully flashed a modded BIOS into the BIOS chip of a Gigabyte mainboard by using lordkag’s resp. rootuser123’s guide.

@rootuser123 :
Can you help?

@Fernando It looks like the efiflash he’s using doesn’t have support for the newer flash chips since lordkag’s one is from 2015. Maybe anyone who understands lordkag’s bypass method can try to mod newer efiflash. Maybe @SoniX , @plutomaniac or @CodeRush can help out.

I think I’m going to return the Samsung 960 EVO + the ASUS Hyper m.2 adapter… I have to save some money in order to upgrade my MOBO. It’s the best option I think.
Well, thank you for all!

How to mod efiflash 0.65? This version of efiflash is included in newer Gigabyte motherboards and I would like to know how to mod it. @SoniX @plutomaniac @CodeRush can help with this one?