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

Installation guide - usage #1

Open
armync opened this issue Nov 19, 2023 · 3 comments
Open

Installation guide - usage #1

armync opened this issue Nov 19, 2023 · 3 comments

Comments

@armync
Copy link

armync commented Nov 19, 2023

For HP UEFI extraction, in my case, none of the extraction options worked. The first two extractors gave me an error about the fact that the installer was not the required one and 7zip only gave me an .efi file not .bin.

Made it by launching the setup and extracting required files. Interesting stuff.

hp_copy_uefi

Secondly, I was unable to find SetupUtility EFI by GUID. I somehow found it trough manual keyword search, such as "Utility". There was Setup folder, with P32 image section. Worth noting for inexperienced users that there are in fact, more P32 sections in the whole image, so searching by that keyword is just a waste of time. As reference, the UEFI is F45 rev A, on OMEN 17 2021.

uefi_utility

Finally, on node, I made it by copying all the files in the node.js root folder, launching cmd (on Windows) via Run as Administrator, giving the directory command (cd) and launching node.exe with its parameters.

@GeographicCone
Copy link
Owner

GeographicCone commented Nov 20, 2023

Thank you for the feedback @armync!

On a general note, these instructions are intended to be more like a fishing rod than a fish. But if they can be improved, I'm all for it. I hope more people can become aware these hidden settings can actually be changed, and also to make it easier for everyone to do so.

For HP UEFI extraction, in my case, none of the extraction options worked

HP makes it particularly cumbersome to get these files out, from my experience more so than other vendors. But it should still be doable. I just tried on the sp149464.exe file for your model. Here's how you can get it out without having to execute it:

  • Use the mentioned 7-Zip-ZStandard to extract the file HPWINGUI.EXE

    • Possibly, the "standard" 7-Zip Non-ZStandard works as well for this purpose, I'm just partial to the beefed-up version
  • Use 7-Zip again on HPWINGUI.EXE to get two files out: a smaller version of 1.HPWINGUI.exe and the payload called 2

    • For this, you have to right-click on the file in 7-Zip shell and choose Open Inside #
    • Or choose 7-Zip ZSOpen archiveOpen # from the Explorer context menu
  • The final piece of the puzzle is to grab AMI_UCP_Extract.py from @platomav's BIOSUtilities repository

  • Well, that's actually not the final piece, since you also need to get TianoCompress.exe from the official ed2k-BaseTools-win32 repository and put it in the external directory, since that's where the common/comp_efi.py module expects to find it.

  • Run AMI_UCP_Extract.py 2 and… voilà:

Result of: dir/b/on/s/
sp149464\2_extracted\088F4.bin
sp149464\2_extracted\088F4.sig
sp149464\2_extracted\CMD_WF.TXT
sp149464\2_extracted\CypressPD.bin
sp149464\2_extracted\CypressPD.sig
sp149464\2_extracted\HP
sp149464\2_extracted\TbtRetimer.bin
sp149464\2_extracted\TbtRetimer.sig
sp149464\2_extracted\UCP_Info.txt
sp149464\2_extracted\UCP_List.txt
sp149464\2_extracted\HP\HPWINGUI
sp149464\2_extracted\HP\HPWINGUI\HPWINGUI_3.55
sp149464\2_extracted\HP\HPWINGUI\HPWINGUI_3.55\Package
sp149464\2_extracted\HP\HPWINGUI\HPWINGUI_3.55\Package\DEVFW1100
sp149464\2_extracted\HP\HPWINGUI\HPWINGUI_3.55\Package\DRIVER40
sp149464\2_extracted\HP\HPWINGUI\HPWINGUI_3.55\Package\DRIVER56
sp149464\2_extracted\HP\HPWINGUI\HPWINGUI_3.55\Package\HPBU3941
sp149464\2_extracted\HP\HPWINGUI\HPWINGUI_3.55\Package\DEVFW1100\HpDevFwUpdate.efi
sp149464\2_extracted\HP\HPWINGUI\HPWINGUI_3.55\Package\DEVFW1100\HpDevFwUpdate.s12
sp149464\2_extracted\HP\HPWINGUI\HPWINGUI_3.55\Package\DRIVER40\amifldrv32.sys
sp149464\2_extracted\HP\HPWINGUI\HPWINGUI_3.55\Package\DRIVER40\amifldrv64.sys
sp149464\2_extracted\HP\HPWINGUI\HPWINGUI_3.55\Package\DRIVER56\amigendrv32.sys
sp149464\2_extracted\HP\HPWINGUI\HPWINGUI_3.55\Package\DRIVER56\amigendrv64.sys
sp149464\2_extracted\HP\HPWINGUI\HPWINGUI_3.55\Package\HPBU3941\BiosMgmt.efi
sp149464\2_extracted\HP\HPWINGUI\HPWINGUI_3.55\Package\HPBU3941\BiosMgmt.s09
sp149464\2_extracted\HP\HPWINGUI\HPWINGUI_3.55\Package\HPBU3941\BiosMgmt.s12
sp149464\2_extracted\HP\HPWINGUI\HPWINGUI_3.55\Package\HPBU3941\BiosMgmt.s14
sp149464\2_extracted\HP\HPWINGUI\HPWINGUI_3.55\Package\HPBU3941\BiosMgmt32.efi
sp149464\2_extracted\HP\HPWINGUI\HPWINGUI_3.55\Package\HPBU3941\BiosMgmt32.s09
sp149464\2_extracted\HP\HPWINGUI\HPWINGUI_3.55\Package\HPBU3941\BiosMgmt32.s12
sp149464\2_extracted\HP\HPWINGUI\HPWINGUI_3.55\Package\HPBU3941\BiosMgmt32.s14
sp149464\2_extracted\HP\HPWINGUI\HPWINGUI_3.55\Package\HPBU3941\CryptRSA.efi
sp149464\2_extracted\HP\HPWINGUI\HPWINGUI_3.55\Package\HPBU3941\CryptRSA32.efi
sp149464\2_extracted\HP\HPWINGUI\HPWINGUI_3.55\Package\HPBU3941\HpBiosMgmt.efi
sp149464\2_extracted\HP\HPWINGUI\HPWINGUI_3.55\Package\HPBU3941\HpBiosMgmt.s09
sp149464\2_extracted\HP\HPWINGUI\HPWINGUI_3.55\Package\HPBU3941\HpBiosMgmt.s12
sp149464\2_extracted\HP\HPWINGUI\HPWINGUI_3.55\Package\HPBU3941\HpBiosMgmt.s14
sp149464\2_extracted\HP\HPWINGUI\HPWINGUI_3.55\Package\HPBU3941\HpBiosMgmt32.efi
sp149464\2_extracted\HP\HPWINGUI\HPWINGUI_3.55\Package\HPBU3941\HpBiosMgmt32.s09
sp149464\2_extracted\HP\HPWINGUI\HPWINGUI_3.55\Package\HPBU3941\HpBiosMgmt32.s12
sp149464\2_extracted\HP\HPWINGUI\HPWINGUI_3.55\Package\HPBU3941\HpBiosMgmt32.s14
sp149464\2_extracted\HP\HPWINGUI\HPWINGUI_3.55\Package\HPBU3941\HpBiosUpdate.efi
sp149464\2_extracted\HP\HPWINGUI\HPWINGUI_3.55\Package\HPBU3941\HpBiosUpdate.s09
sp149464\2_extracted\HP\HPWINGUI\HPWINGUI_3.55\Package\HPBU3941\HpBiosUpdate.s12
sp149464\2_extracted\HP\HPWINGUI\HPWINGUI_3.55\Package\HPBU3941\HpBiosUpdate.s14
sp149464\2_extracted\HP\HPWINGUI\HPWINGUI_3.55\Package\HPBU3941\HpBiosUpdate.sig
sp149464\2_extracted\HP\HPWINGUI\HPWINGUI_3.55\Package\HPBU3941\HpBiosUpdate32.efi
sp149464\2_extracted\HP\HPWINGUI\HPWINGUI_3.55\Package\HPBU3941\HpBiosUpdate32.s09
sp149464\2_extracted\HP\HPWINGUI\HPWINGUI_3.55\Package\HPBU3941\HpBiosUpdate32.s12
sp149464\2_extracted\HP\HPWINGUI\HPWINGUI_3.55\Package\HPBU3941\HpBiosUpdate32.s14
sp149464\2_extracted\HP\HPWINGUI\HPWINGUI_3.55\Package\HPBU3941\HpBiosUpdate32.sig

And you get the Thunderbolt Retimer and the Cypress Power Delivery controller firmware as a bonus.

I'll update README.md with a link to @platomav's repository. It's excellent work, and deserves a mention here.

I was unable to find SetupUtility EFI by GUID

There's a separate tab to search by GUID, I think you might have missed that:

UEFITool-GUID-Search

Because I can find it now that I look:

UEFITool-GUID-Found

It's better to search for a known GUID: and yes, 899407D7-99FE-43D8-9A21-79EC328CAC21 is a well-known GUID for AMI BIOS. I guess for completeness I can also mention the equivalent FE3542FE-C1D3-4EF8-657C-8048606FF670 for Insyde, and link to the rest of guids.csv for all corner cases.

Why is it better to search for a GUID as long as you know one, rather than for a string literal?

  • Because this way you only need to search the headers, not the bodies, which is faster and avoids false positives as every module is referenced by other modules
  • Because strings can be either ASCII or UTF-16 LE so when looking for a string, you might have to search twice
  • Because there will be lots of other matches, especially for a common keyword like Setup

P32 image section

It's PE32, pretty much the same Portable Executable header that is also used by Windows. And yes, most of the BIOS portion of a UEFI firmware image consists of DXE (Driver Execution Environment) modules, all of which will have this header. There are also TE (Terse Executable) images for PEI (Pre-EFI Initialization), an earlier boot stage, but these generally have the Peim suffix. Beyond that, you can find some other data, such as AMITSESetupData with the GUID FE612B72-203C-47B1-8560-A66D946EB371 that is common for all AMI BIOS images, or in this case, an occasional Omen logo as the one under B30FE2CA-15E5-4055-9947-3AB9EC47C788:

Section_Raw_B30FE2CA-15E5-4055-9947-3AB9EC47C788_Body

But most of it is indeed modules with PE32 headers.

There are a number of choices how to extract them, i.e. body vs as-is, but for this purpose it doesn't matter. You will only get different offsets but unless you're using these offsets for anything, they're irrelevant.

Finally, on node [...]

It should be enough to just download node.exe using the direct link: https://nodejs.org/dist/latest/win-x64/node.exe to the same directory as SlimIFR.js and run. There is no need to install anything. I will update the instructions to make that clear.

In any case, I didn't mention these details in the README.md here because it's at most a technical detail relating to another repository, and I might eventually rewrite that script in another language. It's a bunch of regular expressions really, that's all there is to it. On the other hand, it's fine as it is, won't get any better if I rewritten, and since it only has to be used once per BIOS update, which is not very often, it doesn't feel like a priority.

Thank you for your interest in the project, and the suggestions. I can see how the description can be made more approachable, and I will make the changes.

@armync
Copy link
Author

armync commented Nov 20, 2023

These instructions are intended to be more like a fishing rod than a fish

I can see the taken direction. I don't think it would be the most efficient thing to have every step documented or explained, and neither is necessary. In such a case, my intention is to have this issue archived in git, and those who will ever need help will surely seek out this discussion. But now that you mention it, I'm thinking that maybe some heavier steps can be explained in such a way the user community can use, not just the very passionate and experienced. The difficulty of breaking things may induce fear.

Also, from my experience, it could be better categorized in a linear way, e.g. the first step could show perhaps the data extraction from UEFI image then the installation and use, whereas the documentation could be near 'footer'. Or... maybe I'm wrong all-in-all, but I feel like I've been jumping around the guide 😆

a smaller version of 1.HPWINGUI.exe and the payload called 2

That's exactly where I got stuck. Nice to know about AMI_UCP_Extract.py.

There's a separate tab to search by GUID, I think you might have missed that.

I tried it again, and it is working. That's funny, I don't know how I did it wrong. I'm hoping that after looking at it, I didn't forget to press it. 🤨

But most of it is indeed modules with PE32 headers.

Thanks for the explanation. I haven't really researched the firmware-OS side of things.

In any case, I didn't mention these details in the README.md here because it's at most a technical detail relating to another repository,

I understand. It makes sense. Anyway shouldn't be hard enough to get it running but for day-to-day users this Issue will do it.

@GeographicCone
Copy link
Owner

It could be better categorized in a linear way

Yeah, if it were a tutorial or walkthrough. But these are primarily the instructions for using UEFI Variable Tool.

Some people who read them will already know what data they want to read or write, they just want to see the how part quickly.

So the idea is to start with a brief overview, and then get into more detail eventually, first about the application itself, and then also give some context in the Background section, as that's where these instructions are.

That's exactly where I got stuck. Nice to know about AMI_UCP_Extract.py.

Good you found it. I realized I must have actually deleted a bit of my original post where it gave the link to the repository. Fixed it now. The missing part was:



And I've updated the instructions following your feedback. Thanks!

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