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.
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)