[UEFITool] UEFI firmware image viewer and editor

Discussion in 'MDL Projects and Applications' started by CodeRush, Oct 8, 2013.

  1. CodeRush

    CodeRush MDL Member

    Jun 20, 2011
    221
    674
    10
  2. shiecldk

    shiecldk MDL Novice

    Dec 19, 2012
    18
    0
    0
    Thanks for the explanation CodeRush.
    Can I modify the original DSDT stored in AmiBoardInfo if the module is still in the same length with UEFITool?
    Which one should I modify and replace, the ffs file or the its body file (fbd)? And I guess I'll have to rebuild it after replacing?

    And what if I want to replace a ffs with another modified one (wrong checksum, but same length before it being modified)?

    Sorry, I can't make my questions more understandable...:p
     
  3. CodeRush

    CodeRush MDL Member

    Jun 20, 2011
    221
    674
    10
    There is a PE32+ image section inside AmiBoardInfo.ffs module.
    You can extract the body of this section to have BIN file (let's name it ABI.bin here), replace your DSDT with HexEditor in this file (it's better be the same length or smaller, just add enough 0xFF bytes to it's end in that case), then "Replace body..." of that PE32+ image section to the modified file. Check that newly created section (marked as "Replace") has the same size as old one (marked "Remove"), and then save your modified BIOS image.
    PE32+ image has a place for CRC32 checksum in it's header, but it's not used by UEFI executables and remains zero in all images I have seen. Checksums of parent FFS file will be recalculated automatically during image rebuild.
    Answer "Yes" after successful rebuild, if it opens correctly - you are done.

    If you have a file with wrong checksums, just mark it to rebuild (Ctrl+Space), and checksums will be recalculated during image rebuild, then save the modified image.
     
  4. nexus76

    nexus76 MDL Addicted

    Jan 25, 2009
    788
    300
    30
    Hi coderush,

    great tool so far, an option to re-compress all modules would be fantastic to harvest some free space,
    do you think it makes sense?

    best regards
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. CodeRush

    CodeRush MDL Member

    Jun 20, 2011
    221
    674
    10
    Nope. Tiano compression have no parameters, so recompression wil be 100% useless, LZMA have some, but you will free about 50 Kb of space for the price of longer startup. The best way to earn some space is to reorganize and resize volumes, shrink ME region to it's normal size of 0x1f0000 if it's bigger, and to remove useless modules such as Tcp4.ffs and so on.
     
  6. CodeRush

    CodeRush MDL Member

    Jun 20, 2011
    221
    674
    10
    0.17.1 is out like a day ago, but I forgot to mention it. It's a small code-cleaning release, made because 0.17.0 binary for OSX was buggy and has bad fonts.
    Changes:
    - added "NVRAM" module type (detection algorithm needs to be done better, I know:))
    - fixed typos in source code
    - Monaco 10pt is a new default font for OSX builds
     
  7. CodeRush

    CodeRush MDL Member

    Jun 20, 2011
    221
    674
    10
    It's not possible with SCE either. I will do something about NVRAM, when I have a system to test.
     
  8. BDMaster

    BDMaster MDL BIOS/EFI Modifier

    Aug 2, 2009
    821
    313
    30
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  9. CodeRush

    CodeRush MDL Member

    Jun 20, 2011
    221
    674
    10
    0.17.2 is out. Bugfix release once again.

    Changes:
    - Pad file GUIDs will now be preserved after volume modification (thanks AMI for not following UEFI PI specs)
     
  10. CodeRush

    CodeRush MDL Member

    Jun 20, 2011
    221
    674
    10
    BDMaster, thank you for your report, files and suggestions.
    HP files are not well-formed UEFI images (they are encrypted, I think), others have some non-critical structure flaws, but it can be tolerated.
    Prenamed output files is a good idea, will be done in one of next releases.
    Extract all is a nice feature to implement, will be done too.
     
  11. CodeRush

    CodeRush MDL Member

    Jun 20, 2011
    221
    674
    10
    0.17.3 is out. Minor bugfix release.
    Changes:
    - descriptor access settings was shown incorrectly, now solved

    I have a very limited time for any projects because of my master thesis, so UEFITool's development may stall for a bit, but if you have found a bug - I will try to solve it ASAP. There will be another bugfix release in 1-2 days, I think.
     
  12. tids2k

    tids2k MDL Novice

    Jul 16, 2009
    48
    9
    0
    Can this tool be used to open arm efi boot files bootarm.efi for example?
     
  13. CodeRush

    CodeRush MDL Member

    Jun 20, 2011
    221
    674
    10
    I think that EFI file is not an UEFI Image, but a single executable, so the answer is no, but you can try and report anyway.
     
  14. Tito

    Tito Super Mod / Adviser
    Staff Member

    Nov 30, 2009
    18,681
    18,589
    340
    Yes, bootarm.efi is EFI executable, not firmware image.
     
  15. CodeRush

    CodeRush MDL Member

    Jun 20, 2011
    221
    674
    10
    0.17.4 is out

    Changes:
    - solved a bug in wrong volume size calculation in rare cases
    - added diagnostic message if FvLength and size calculated using BlockMap are different
    - solved a bug that lead to unneeded PEI files relocation
    - rebuild action on volume will now relocate PEI files in it

    Thanks to lordkag for reporting.
     
  16. Tito

    Tito Super Mod / Adviser
    Staff Member

    Nov 30, 2009
    18,681
    18,589
    340
    #98 Tito, Mar 1, 2014
    Last edited by a moderator: May 23, 2017
  17. =)(=

    =)(= Guest

    #99 =)(=, Mar 1, 2014
    Last edited by a moderator: May 23, 2017
  18. CodeRush

    CodeRush MDL Member

    Jun 20, 2011
    221
    674
    10
    Checked this out on my Zotac Z77 board - it doesn't work for me even after starting DXE driver and then running the image itself. It just returns EFI_SUCCESS and does nothing more. I can't figure out all dependencies of that EFI application, but I'm sure it's possible to transfer it, but it will be rather hard to do so without actual board to test. And I can't see how this feature can be somewhat useful ti dedicate much time for it's development, sorry.