Update CPU Microcode + Fix FIT Using UEFITool / Hex
This is a quick requested guide I put together for someone, on how to edit CPU microcoded with UEFITool and how to update/correct the FIT table in some BIOS.
There is already a guide here on how to update microcodes using these very same methods, which includes a brief section on correcting FIT table, but some users have asked for a little more info/guidance on how to do both of these things especially FIT corrections…
So here is my method of doing both of these edits, hopefully it will help fill in some gaps the other guide may leave for some users.
Mainly this guide will focus on correcting FIT table, since redoing microcodes via hex is tough to explain guide-wise and the above guide already does a better job than I can at explaining that aspect.
This guide applies mainly to modern Intel boards that contain a FIT table, if you do not see one in your BIOS with UEFITool NE Alpha, or you have AMD board, this guide will not be very helpful for you due to microcode edit section is not in-depth.
FIT table can be viewed here with UEFITool NE Alpha, example of invalid and valid FIT is show, if you are reading this guide please enlarge so will see how to immediately recognize the difference
If this is broken in your stock BIOS, that’s not how it’s supposed to be, this only means manufacturer was being lazy and didn’t notice or fix, or has poor BIOS coding skills Please fix this for yourself even if not modifying your BIOS otherwise
Tools needed:
Both UEFITool & UEFITool NE Alpha
Hex editor of your choice, I use paid version of Hex Editor Neo they do have freeware version too, another good one many use is HxD Hex Editor
Standard built in windows calculator (Set to “Programmer Mode” with “Hex” selected on left), or any other hex capable calculator
FIT Table is often (Maybe always?) at GUID - B52282EE-9B66-44B9-B1CF-7E5040F787C1
This contains the CPU microcode locations first called by the BIOS. Sometimes there is two actual locations (dual microcode files in seperate volumes), the FIT table only contains info to point the BIOS to the first microcode locations.
FIT table also sometimes includes locations to Intel BootGuard/ACM keys, hash and policy locations. The first entry is always the FIT header, this contains the GUID, header and data (body) checksum, type and attribute value, file size and state value.
The body of the FIT file contains all the rest of the information mentioned previously, microcode locations and BootGuard/ACM keys, hash and policy file locations.
In the FIT body, the 8th or 9th byte is always the total count of entries in the FIT table, verify this against what you see in UEFITool FIT Tab count total, if incorrect it should be updated to actual value
This count includes the header, all CPU microcode entries, any additional but empty (not blank/incorrect) microcode locations, and the BootGuard/ACM keys, hash and policy file entries if present
When working with the FIT file, for the general purposes here, you only need to extract the "body", if you need to correct checksums post-edit that can be done in a seperate edit.
If checksum corrections are needed, they will usually be corrected by UEFITool upon saving, so you likely will never have to correct these or worry about that.
You can double click the FIT header in UEFITool tab to be taken to the FIT module in the BIOS, the same applies for CPU microcodes when there is at least one microcode entry still in the table (Sometimes when blank, you can still click empty address and get there).
If there is not, you will need to find the microcode modules via other means such as GUID Search or use UEFITool "Go To Address" and enter the incorrect address shown on the left side of the blank/broken microcode entry, usually that will still take you to the correct file containing the microcodes.
CPU Microcodes are often (maybe always?) at GUID - 17088572-377F-44EF-8F4E-B09FFF46A070
Sometimes you will find 2-3 x this GUID via search as seen in above image. In those instances check each one via hex view, when there is 3, usually the first one is not the file we want to edit, which you can recognize by it only containing a header and rest filled with FF’s.
We want to edit 2nd and/or 3rd entries, these contain the CPU microcodes. Each of those modules is a duplicate, so you can extract and edit one, but be sure to replace both with the updated file.
When updating microcodes via UEFITool extract using “Extract Body” and replace updated file via “Replace Body”
Editing microcode file can be done two ways, whichever is easier for you to do. First way, simply make a new hex file and copy in the microcodes one after another into the file.
Second way is open the original and search for each old microcode file one by one, then replace with new version. The second way is only easy if old and new microcodes are the same size, otherwise you will need to move next one down/make room etc.
Personally, I find it’s much easier to make a new microcode file from scratch, that way you do not have to worry about or wrestle with files sizes and trying to figure out how/where things can fit or be moved to etc.
Always check the original microcode file to see if there is space (FF or 00) between microcode entries or not, sometimes there is and sometimes not. Sometimes you need to start each one at a certain offset, followed by FF’s up to the next one at certain offset.
I am not sure how to explain making these changes or choices on offset starting points, apologies to all! I’ve mainly only seen this matter on AMD, and some older Intel.
I think, usually offsets need to be multiplies of 800h or 1000h, but sometimes this is not correct either, and you’ll need to look at the original microcode file raw with MC Extractor and guess based on how the old offsets looked.
Also always check the last line of any microcode file you edit, sometimes there is a footer, and this needs to remain in place, or be added back in when done or when creating your own new file from scratch.
And as mentioned previously, there is already a guide for updating microcodes via hex here on the forums, that should guide you along best if you need help in hex edit copy/paste etc
[GUIDE] AMI INTEL CPU Microcode Update Guide
Fixing the FIT Table
1. Open your BIOS file in UEFITool NE Alpha, Drag and drop to open is possible >> Locate FIT via searching for GUID B52282EE-9B66-44B9-B1CF-7E5040F787C1, or by double clicking FIT header in FIT tab, extract body.
Apologies for the possibly confusing image below, I’ve extracted “As-is” for this guide, even though I will not be making any header changes, so header will be visible in all hex images as well, apologies in advance!
2. Open FIT file in hex editor >> File_Raw_B52282EE-9B66-44B9-B1CF-7E5040F787C1.ffs file or File_Raw_B52282EE-9B66-44B9-B1CF-7E5040F787C1_body.raw if you extracted body
3. Go back to opened BIOS in UEFITool NE, and navigate to the FIT Tab, we’ll use “Size” and “Address” info from here in next steps.
If you have room on monitor, open hex and UEFITool side-by-side for easier workspace
4. Open windows calculator, and in top section open "View" menu and choose "Programmer", then on left side ensure "Hex" is selected
5. Locate the first microcode entry in hex file, and UEFITool NE - this value we change first, in order to be able to start adding the rest of the locations and sizes
6. In UEFITool NE locate the first actual “microcode containing” GUID 17088572-377F-44EF-8F4E-B09FFF46A070. If there is only one entry for your BIOS when searching for 17088572-377F-44EF-8F4E-B09FFF46A070, that is the file you want here, if there is 2-3, usually second one
Double click the entry in search results at bottom so you are taken to the files location, then click on it to be sure it’s selected. On the right info area, we need value from “Data Memory Address” This is start of the first microcode, highlight and copy value
7. In calculator paste or enter the first microcodes “Data Memory Address” found at above step, we’ll do nothing more in calculator for this step, leaving this value to add onto in next few steps
8. In hex editor, we’ll now correct the first CPU microcode entry in the FIT Table. These values are stored in reverse order, for example this means that a value of FFE05A50 is stored in the FIT table as 505AE0FF
Edit in your first value, from step #6 in hex editor at the first microcode entry line, I reverse order as mentioned above
9. Save the file in hex, either save as is, or save a copy noted as “Modified” etc. This process will be repeated several more times, with added step for each additional microcode, then saved and re-inserted after each edit.
Once you become more familiar with the process, you can edit all at once after the first entry is saved and entered, because you will be able to skips steps due to knowing previous and next microcodes size and thus the next ones location/address.
You will be able to correct each subsequent microcode address by adding previous microcode’s size to get next address, hard to explain but you’ll see what I mean after doing this a few times and are familiarized.
10. Open BIOS in regular UEFITool, then search for FIT at GUID >> B52282EE-9B66-44B9-B1CF-7E5040F787C1 and replace “Body” or “As-Is” depending on how you originally extracted
Then save BIOS image, as a modified file so you know which is original and which is modified. When asked if you want to open modified file, say yes and leave open, you will come back several more times to reinsert FIT module.
11. Open modified BIOS again in UEFITool NE Alpha, go to the FIT Tab, and see now there is corrected entry for the first CPU microcode
12. Now, open your modified FIT file again in hex, if not already left open, now we will fix second entry. To fix each subsequent entry all you do is enter the previous microcode’s starting address into the calculator, then add it’s size.
The result is the next CPU microcodes address value that you will put into FIT via hex, as you did in step #8 So for this guide, we’ll add FFE05A50 + value seen in the “Size” column for this microcodes entry which is 6000 (So FFE05A50 + 6000 = FFE0BA50)
This value FFE0BA50 will be entered in FIT file via hex, this will be the starting address of the next microcode. Once completed with this step, then see steps 8-9-10-11 again
Updating each subsequent microcode entry will be this step + steps 8-9-10-11 again each time, checking to be sure everything looks correct and updates each entry as you go
As mentioned on step #9 once you become more familiar with the process you will be able to skip steps, but it takes a while and sometimes there will be mistakes you need to go back and fix.
If one entry is off, all the following will be off and will remain blank until the first missing entry is corrected.
13. Repeat step #11, see second entry is now corrected, repeat steps 8-9-10-11 as many times as microcodes your BIOS has. You can view how many microcodes your BIOS has by dropping BIOS onto MC Extractor
Only a single microcode volume is used here, if your BIOS has duplicated microcode volumes only first one applies for this process. Meaning if you see set of duplicated CPU microcodes in MC Extractor or MMTool/AMIBCP etc, only the first set is used here.
Hope this helps some of my fellow BIOS modders!
If you have any questions, or need me to add any additional step/process please feel free to let me know, thanks!