Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

modifying default (optimal) settings ignored #6

Closed
CherAlban opened this issue Mar 10, 2023 · 17 comments
Closed

modifying default (optimal) settings ignored #6

CherAlban opened this issue Mar 10, 2023 · 17 comments

Comments

@CherAlban
Copy link

CherAlban commented Mar 10, 2023

I tried to modify default (optimal) settings of an ASUS H610T bios according to the instructions given. All went as described, except:

  • when downloading the modified files, only changelog.txt and Section_Freeform_subtype_GUID_setupdata_setupdata_AMITSESetupData_body.bin are being downloaded
  • when inserting the modified file into the original .cap in UEFITool_0.28 at the corresponding GUID, all "text" looked totally different and non readable compared to the UEFITool_NE version
  • I flashed and verified the resulting binary onboard using a USB SPI programmer
  • The main-board boots, it has the new bios, except that it seems to have ignored all my changes
  • When checking the modified .cap file by also extracting and opening it in UEFI-Editor, all changes are displayed correctly

Am I missing something in the process, or what could be the problem?

Thanks for the excellent work!

@BoringBoredom
Copy link
Owner

  • Optimal resides in the setupdata BIN, so that's expected. Where was it described otherwise?
  • Can you elaborate?
  • Optimal is just one of various ways UEFI vendors handle defaults. There is DefaultId, Default and MfgDefault which reside in the Setup SCT (tool doesn't handle those, they need manual hex edits).

@CherAlban
Copy link
Author

I did the same modifications by editing Optimal for the ASUS H110T, H310T and H410T boards using AMIBCP5. For the H610T bios, even the latest AMIBCP 5.02.0034 I could find aborts with the known "Maximum number of strings per section exceeded" error message.

I had hoped that using UEFI-Editor would simply work the same way. If ASUS with the H610T changed how they manage default values, I expected the Optimal settings at least to get loaded when "Load Optimized Defaults" is applied, but nothing happens.

If I did not do anything wrong when using UEFI-Editor, it looks like I am stuck at this point.

Many thanks for all of your work and effort!

@BoringBoredom
Copy link
Owner

BoringBoredom commented Mar 10, 2023

I had hoped that using UEFI-Editor would simply work the same way.

It does. Try loading your H410T BIOS in UEFI Editor. It should reflect the AMIBCP changes accordingly. If not, let me know and I'll look into it. I suspect ASUS just changed the behavior on H610T, though.

@CherAlban
Copy link
Author

CherAlban commented Mar 14, 2023

There is DefaultId, Default and MfgDefault which reside in the Setup SCT (tool doesn't handle those, they need manual hex edits).

I see DefaultId tags present in H610T compared to H410T, but I have no idea how to modify these. Can you maybe give me a hint where this is explained?

@BoringBoredom
Copy link
Owner

@CherAlban
Copy link
Author

Sorry that I still don't get it. I extracted Section_PE32_image_Setup.sct and converted it to Section_PE32_image_Setup.sct.0.0.en-US.ifr.txt as described in your manual. I can open the .txt and see the following section dealing with "Restore AC Power Loss"

image

I assume I have to do the needed modifications in Section_PE32_image_Setup.sct using a hex-editor. But what would I change where when I want to set the DefaultId to e.g. "Last State" Value 2? How do I calculate the hex address?

I really appreciate you patience...

@BoringBoredom
Copy link
Owner

I assume I have to do the needed modifications in Section_PE32_image_Setup.sct using a hex-editor.

Yes.

Jump to offset 0x8B2A8, then change the last byte of 5B 06 00 00 00 01 to 02 -> 5B 06 00 00 00 02.

@CherAlban
Copy link
Author

I played with changing default values, unfortunately none of them worked.

Try loading your H410T BIOS in UEFI Editor. It should reflect the AMIBCP changes accordingly. If not, let me know and I'll look into it. I suspect ASUS just changed the behavior on H610T, though.

I tried what you suggested using an H310T board and replicated the same changes I did in AMIBCP in UEFI-Editor (just modifying the Optimal values, starting from a stock bios). Surprisingly, the version created using UEFI-Editor does not work, all changes are ignored, just as with the H610T.

@BoringBoredom
Copy link
Owner

Are you sure you replaced the file correctly? Have you tried loading an image modified with AMIBCP in UEFI Editor and vice versa? Can you give me the UEFI download link, the data.json with the attempted modifications and the SHA256 of the final ROM?

@CherAlban
Copy link
Author

CherAlban commented Mar 17, 2023

I downloaded the original bios for H310T 2.0 from:
https://dlcdnets.asus.com/pub/ASUS/mb/BIOS/PRIME-H310T-R2-SI-2208.ZIP?model=PRIME%20H310T%20R2.0

To make things easier for testing, I just modified one single value of the original.cap file using AMIBCP 5.02.0031 and did the same change using UEFI Editor (as described in the manual), resulting in the two files amibcp.cap and uefieditor.cap
(Setup/Boot/Boot Configuration/Wait for 'F1' If Error/ changing Optimal from Enabled to Disabled)
SHA256 of uefieditor.cap -> 6060614e14a8746ad08987b7cc9dd28800feda4be50f25f31bc0190c424b550f

Using UEFITool_NE.exe with the original, amibcp and uefieditor .cap files I extracted nine files:
Section_PE32_image_Setup.amibcp.sct
Section_PE32_image_Setup.uefieditor.sct
Section_PE32_image_Setup.original.sct

Section_PE32_image_AMITSE.amibcp.sct
Section_PE32_image_AMITSE.uefitool.sct
Section_PE32_image_AMITSE.original.sct

Section_Freeform_subtype_GUID_setupdata_AMITSE_body.amibcp.bin
Section_Freeform_subtype_GUID_setupdata_AMITSE_body.uefitool.bin
Section_Freeform_subtype_GUID_setupdata_AMITSE_body.original.bin

The three Setup.sct files are identical. (as expected)
The original and uefieditor AMITSE.sct files are identical, but differ in many bytes to the amibcp version.
The amibcp and uefieditor .bin files are identical and differ in just one bit to the original. (as expected)

Using UEFITool0.28.00.exe I extracted the bodies of the two altered .cap files and flashed to them to the H310T using AFUDOS /GAN
amibcp.rom -> default setting changed
uefieditor.rom -> default setting not changed

@BoringBoredom
Copy link
Owner

Can you upload Section_PE32_image_AMITSE.amibcp.sct? I wasn't aware of the extra modifications AMIBCP does in AMITSE.sct for Optimal.

@CherAlban
Copy link
Author

@BoringBoredom BoringBoredom added the help wanted Extra attention is needed label Mar 17, 2023
@BoringBoredom
Copy link
Owner

I'm at a loss here. Tagged this issue with help wanted for now.

@BoringBoredom BoringBoredom added the bug Something isn't working label Mar 17, 2023
@CherAlban
Copy link
Author

CherAlban commented Mar 17, 2023

I applied all my needed changes subsequently in six steps and extracted the AMITSE after each step. Funny thing is, AMITSE does only get altered with the first change, but not for subsequent changes (SHA256 / file-name):

53d260341b232c0d8c27dea4d32fbcd2c7e6deaa480e21b644b7999163eabba8 Section_PE32_image_AMITSE1.sct
53d260341b232c0d8c27dea4d32fbcd2c7e6deaa480e21b644b7999163eabba8 Section_PE32_image_AMITSE2.sct
53d260341b232c0d8c27dea4d32fbcd2c7e6deaa480e21b644b7999163eabba8 Section_PE32_image_AMITSE3.sct
53d260341b232c0d8c27dea4d32fbcd2c7e6deaa480e21b644b7999163eabba8 Section_PE32_image_AMITSE4.sct
53d260341b232c0d8c27dea4d32fbcd2c7e6deaa480e21b644b7999163eabba8 Section_PE32_image_AMITSE5.sct
53d260341b232c0d8c27dea4d32fbcd2c7e6deaa480e21b644b7999163eabba8 Section_PE32_image_AMITSE6.sct

Unfortunately I cannot do any changes to the needed H610T bios, as none of the AMIBCP tools I could find is able to correctly open the original file. The patched AMIBCP5.02.0031 opens it somehow, but displays many values as Undefined, and crashes each time when trying to save.

@BoringBoredom
Copy link
Owner

My guess is AMIBCP does some groundwork inside AMITSE.sct to make sure it honors Optimal. Out of curiosity, have you tried changing DefaultId?

@CherAlban
Copy link
Author

Yes, I tried changing DefaultId, but with no effect.

@BoringBoredom
Copy link
Owner

Moving this issue to #9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants