[TOOL] UEFI Editor

Hello

Can you allow multi-byte values please for numeric fields, for example if the maximum (or minimum) uses 2 bytes … ? Or more bytes ?

I would like to update by Precision Boost Overdrive (PBO) parameters for Ryzen CPUs (PPT, TDC, EDC), but the JavaScript form only allows me to input a single byte in hexadecimal, and I can not input 300 Ampers for EDC

I got something like this. I cant access 0x2712 advanced menu, how to make it works?

Hello.
I’m up to try adding more options to the tool. Could you clarify my understanding of code? I need help because when I add another bytes to array, the tool starts changing the values itself with no input from user.

Are my comments correct?

function getAccessLevels(
  bytes: string,
  hexSetupdataBin: string
): [string, string, string, Offsets] | [null, null, null, null] {
  const byteArray = bytes.split(" ");
  const regex = new RegExp(

      //Sort by Question ID
      byteArray[6] +
      byteArray[7] +

      //Skip 14 bytes and parse AccessLevel
      ".{28}(..).{6}" +

      //Sort by Description string ID, skip 26 bytes, sort by Name string ID
      byteArray[4] +
      byteArray[5] +
      ".{52}" +
      byteArray[2] +
      byteArray[3] +

      //Skip 2 bytes and parse defaults
      ".{4}(..)(..)",
    "g"
  );

Optimal and Failsafe are one byte fields. Use this method for now.

What exactly are you trying to do?

I tried to add a field that controls “page id”.

Like
".{20}(....).{n}"

See the .pdf

I was half successful. The new field displayed the value, but you can’t enter two bytes. And the tool went crazy changing different values.

Sorry, but I still have no clue what you’re trying to do or what the purpose of controlling “page id” is.


UEFI Editor allows changing the target form of top-level references in Menu. I want to make the target of “Ref To” entrys type changable as well. In fact, page id is assigned in any type. In any other non-“Ref To” type it is just “FF FF”.
Is this not feasible?

UEFI Editor is not happy about Dell, Asus, Gigabyte desktop bios. Changes to top-level references do not work as expected.

So, to sum this up: setupdata stores the target Forms of Ref Prompts in 16 bit fields, and the goal is to parse those and add a new column to the table that lets you change the target Form to anything you want?

Yes. Exactly.


I was scratching my head what’s the problem the entire yesterday afternoon.

I tried to parse all bytes in the same Function.
function getAccessLevels(
  bytes: string,
  hexSetupdataBin: string
): [string, string, string, string, Offsets] | [null, null, null, null, null] {
  const byteArray = bytes.split(" ");
  const regex = new RegExp(
      byteArray[6] +
      byteArray[7] +
      ".{20}(....).{2}" +
      ".{2}(..).{6}" +
      byteArray[4] +
      byteArray[5] +
      ".{52}" +
      byteArray[2] +
      byteArray[3] +
      ".{4}(..)(..)",
    "g"
  );

  const matches = [...hexSetupdataBin.matchAll(regex)].filter(
    (element) => (element.index as number) % 2 === 0
  );

  if (matches.length === 1) {
    const match = matches[0];
    const index = match.index as number;

    const offsets: Offsets = [
      decToHexString((index + 24) / 2),
      decToHexString((index + 32) / 2),
      decToHexString((index + 104) / 2),
      decToHexString((index + 106) / 2),
    ];

    return [match[1], match[2], match[3], match[4], offsets];
  }

  return [null, null, null, null, null];
}

In result the tool went crazy overlapping one value with another.
Then I reached out to you to confirm my understanding of the regular expression in th code. But instead of an answer I got twice questioned. No problem.

Today I decided to separate Page ID parsing to a different function.
function getPageIDs(
  bytes: string,
  hexSetupdataBin: string
): [string, Offsets2] | [null, null] {
  const byteArray = bytes.split(" ");
  const regex = new RegExp(
      byteArray[6] +
      byteArray[7] +
      ".{20}(....).{12}" +
      byteArray[4] +
      byteArray[5] +
      ".{52}" +
      byteArray[2] +
      byteArray[3],
    "g"
  );

  const matches = [...hexSetupdataBin.matchAll(regex)].filter(
  (element) => (element.index as number) % 2 === 0
  );

  if (matches.length === 1) {
    const match = matches[0];
    const index = match.index as number;

    const offsets: Offsets2 = [
      decToHexString((index + 24) / 2),
    ];

    return [match[1], offsets];
  }

  return [null, null];
}

Somehow that helped.
Probably I missed something yesterday trying to do the job with the only function. Or I might misunderstood regex?


Anyways, I’ve managed to add the column. GitHub - Maxinator500/UEFI-Editor: Aptio V UEFI Editor

I was asking since I figured you’d prefer if I implemented it in the main branch. Regarding the getAccessLevels function: for some reason, your fork has 1451 additions and 1519 deletions, so I can’t tell what’s going on.

If you switch to ignore whitespace, there will be 116 additions.

Oh, that commit is using a separate function and property. Anyway, you have to keep the order of offsets in the array the same since they’re being accessed by index here. In hindsight, I should’ve just used an object with proper property names, but back then I was planning on keeping the .json somewhat compact because it was meant to be an IFR Formatter output replacement (which is whatever now since I wrote another formatter). I’ll change that array to an object eventually to make it less confusing.
Regarding the page IDs: I was thinking of just adding a dropdown to the “Info” column for Ref Prompts to avoid making the table even wider. I’ll try to confirm that this method works on various boards before implementing it.

I know. Like, (child.offsets[0]), (child.offsets[1]) and etc. I added up to (child.offsets[3]). Order was correct. And the tool still had weird behaviour.

The second thing I want to add is new entry type that can’t be parsed from IFRE output.

This type is intended to be used on My Favorites tab.

But it can be also used on any other. It might be handy to access Forms outside Setup, if you aren’t going to enhance the Menu section.

I can’t flash the modded BIOS, I need a signature file and the one from the original BIOS version (that I modified) does not work.
I have also tried to “trick” the flash tool that I want to flashback or recovery-flash (Win+B on boot) but it’s the exact same thing everywhere.

I have read in several places that the signature is not needed but for me it clearly is.
What am I doing wrong?

The numbers I see when comparing the intact and modified BIOS files all seem to check out, I used the older version of the UEFITool to create the bin.

(I have modded BIOSes before, but we didn’t have signatures, UEFIs, certificates or really anything but simple checksums. Sure, if you fd up you fd up for real, but at least you knew if your were making any progress at all :confused: )

Thankful for any and all help.
Omen 25L GT-12xxxa, F.28a.

This is HP. You can’t mod it.

1 Like

I’ve looked through the PDF and your repo a bit. I’m confused why you replace 4 bytes in the PDF but only 2 bytes in the repo. The location also seems to be different.

First two bytes are for parent Page ID. It goes to this ID when you press Esc.

Could you elaborate?

In your fork, you did .{20}(....) while it should be .{14}(........) from what I’ve gathered from the PDF. Am I missing something?

Firstly, in the PDF I was converting every little endian values to big endian. So,
parent[01 00] and destination[3B 00]
to [00 01] and [00 3B].
That’s where 00 01 00 3B came from.

Secondly, you allowed to not alter the parent id. This wasn’t said in the pdf and it sucks in this term.