Experiment: Modding HP bios to get UEFI boot support

Discussion in 'BIOS Mods' started by Tito, Jul 1, 2014.

  1. Tito

    Tito Super Mod / Adviser
    Staff Member

    Nov 30, 2009
    17,574
    15,381
    340
    #1 Tito, Jul 1, 2014
    Last edited by a moderator: Apr 20, 2017
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. Tito

    Tito Super Mod / Adviser
    Staff Member

    Nov 30, 2009
    17,574
    15,381
    340
    Reserved for future :D
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. Flipp3r

    Flipp3r MDL Expert

    Feb 11, 2009
    1,529
    654
    60
    I have an MSI CX720 notebook that I used to experiment with installs. Once UEFI became popular I had a look to see if this model could do it.
    There were no options in bios so I loaded it up into AMIBCP. It had reference to UEFI so I enabled it. Flashed ok.
    Turning on that function crippled it. Could not get back into bios. Boot menu F11 key did not work. It would try to boot hdd but blue-screen.
    Eventually I emailed MSI about bios recovery. It ended up getting sent back to them I they replaced the motherboard! It was well out of warranty & totally my fault.
    I was surprised but thankful. I still have this notbook & use it for integrating/updating wims...

    So, just be carefull with your mods... & Good luck!
     
  4. Tito

    Tito Super Mod / Adviser
    Staff Member

    Nov 30, 2009
    17,574
    15,381
    340
    Winkey + B is my weapon ;)
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. donovan6000

    donovan6000 MDL Novice

    Dec 29, 2010
    33
    13
    0
    #5 donovan6000, Jul 2, 2014
    Last edited: Jul 2, 2014
    Nice post :D

    Also I'd like to mention that replacing the SHA1 hash can interfere with the crisis recovery since the process uses CryptRSA.efi to verify and launch HpBiosUpdate.efi. So be careful everyone! :p

    And big thanks to zuvieltext! Even though he doesn't know it, he inspired me to try out changing the SHA1 hash to launch different EFI applications.
     
  6. CodeRush

    CodeRush MDL Member

    Jun 20, 2011
    221
    655
    10
    GPT drives have no MBR code, so they will normally be listed in Boot Device Selection screen only if they have FAT32 partition with /EFI/BOOT/bootx64.efi on it. If UEFI boot is implemented and not disabled, the file will be found and showed as "UEFI:DriveName"
     
  7. Tito

    Tito Super Mod / Adviser
    Staff Member

    Nov 30, 2009
    17,574
    15,381
    340
    @CodeRush

    Is it possible to add Secure Boot feature or BGRT table as modules to an AMI Aptio bios from another one??
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  8. gabiz_ro

    gabiz_ro MDL Member

    Feb 2, 2010
    170
    12
    10
    #9 gabiz_ro, Jul 7, 2014
    Last edited by a moderator: Apr 20, 2017
    After few test and dumps I think at [rsp+0D8h+var_68] must be number of partition detected and must be checked.
    I get this values
    2 only with HDD connected (have 2 partition, win7 system reserved an C )
    3 with HDD and one USB pen drive
    4 with HDD and two USB pen drives.

    This is after a patch that from jz to jmp
    That get GPT disk and available EFI boot found listed under F9 boot menu.

    But in normal startup or on initial run of this sub-function [rsp+0D8h+var_68] is always 0
    And there is a conditional jump
    Code:
    mov     rax, [rsp+0D8h+var_68]
    xor     esi, esi
    test    rax, rax
    jz      loc_180003084
    rax being 0 jump over check if EFI enabled in Setup and searching for \\EFI\\Microsoft\\Boot\\bootmgfw.efi or \\EFI\\BOOT\\BOOTX64.EFI

    Maybe if someone can provide some dumps from similar HW or SW version who can switch from legacy to EFI will have a start point.
    For now I can see that Enabling or disabling UEFI in BIOS Setup have no real effect on BDS module, dump of BDS are identical,even if I find part of code who check if offset 7Eh is 0 in Setup variable.
    So maybe what trigger BDS to be in EFI mode is in other module.
    I found offsets pointing to HiiDatabase,OemSetupBrowser,OemServicesDriver,MonitorKey and H19DxeServiceBody
     
  9. CodeRush

    CodeRush MDL Member

    Jun 20, 2011
    221
    655
    10
    @Tito, yes, but it will be very hard to implement.
    BGRT is not just an ACPI table, it must be disabled in legacy mode, so the table is generated in runtime from BMP file. This functionality is not wrapped to a module, but a part of another one - AmiTse. You could try to replace this module with one from different board but I doubt it will work as expected.
    SecureBoot can be ported too but it requires changes to image structure, copy of default keys, special nvram variables support, special nvram driver and enabled BIOS lock to function normally, so if BGRT integration looks hard but possible, integrating SecureBoot into compiled image would be an act of heroism.
    There nothing impossible, but it will be much easier to just buy new system with this functions enabled by default.
     
  10. zft561068

    zft561068 MDL Novice

    Jul 4, 2014
    1
    0
    0
    #11 zft561068, Jul 7, 2014
    Last edited: Jul 7, 2014
    THe good new!
    I have be tested . The computer BIOS is F24 (Sp53872.exe) , I am patched F24 ,modify the XXXXXX........XXXX.rom (the CryptRSA.efi SHA1 in this rom).
    do sthing:
    1、using
    PhoenixTool open 0166cf24.bin
    2、in dump
    directory, using HxD do “SHA1 with refind_x64.efi “ replace that “SHA1 with CryptRSA.efi,
    3、make
    0166cf24_SLIC.bin by PhoenixTool
    4、rename 0166cf24_SLIC.bin to 0166cf24.bin and using insydeFlash flash this .
    5、copy refind\*.* to USBNAME:\Hewlett-Packard\SystemDiags\
    6、in USBNAME:\Hewlett-Packard\SystemDiags\ rename CryptRSA.efi to CryptRSA.efibak and rename refind_x64.efi to CryptRSA.efi
    7、now ,restart the computer ,press "F2",computer display the " refind boot gui" as same as the top Second JPG by Tito send
    8、later,halt the computer .
    9、press WIN+B and press power-button ,computer reflash F24 ok
    how much file in my USB SD:
    them is:
    \Hewlett-Packard\BIOSUpdate : CryptRSA.efi、 HpBiosUpdate.efi 、other files
    \Hewlett-Packard\SystemDiags : CryptRSA.efibak、SystemDiags.efi、 CryptRSA.efi (rename by refind_x64.efi) 、other files
    \Hewlett-Packard\BIOS : CURRENT\ 0166C.bin ,CURRENT\ 0166C.SIG them by 0166CF24.bin using PhoenixTool make.
    \Hewlett-Packard\*.* make by sp63063.exe ;
    10、F2 start refind gui and win+B recorvey BIOS also work good! and my HDD no HP_TOOLS Partition
    11、but not test in F32 ,because F32 have boot first check RAS , F24 is no have.
    12、using F2 start: bios -> \Hewlett-Packard\SystemDiags\CryptRSA.efi (rename by refind_x64.efi) checking SHA1
    using WIN+B : bios -> \Hewlett-Packard\BIOSUpdate\CryptRSA.efi not checke or who is checking ????????????:confused::confused:

    I have know little English ,not laugh me.
     
  11. HaTToR

    HaTToR MDL Novice

    Jul 11, 2014
    2
    0
    0
    Hello all,, any progress ?? i was waiting for this :)
     
  12. HaTToR

    HaTToR MDL Novice

    Jul 11, 2014
    2
    0
    0
    Insyde Sofwares answer for UEFI mod.

    Mailed to Insyde Software customer support and their answer:

    Me:
    "This is what HP says. And i dont have that special skills, so i need help about this. Can anyone help me about this?



    UEFI technology enables a number of improvements in PC security and performance and is implemented in all PCs pre-installed with Windows 8. Some PCs pre-installed with Windows 7 contain UEFI technology and can be modified to deliver these features. However the process requires specialist skills to complete and at this time, HP is not providing instructions to perform this modification."


    Insyde:
    "Developing UEFI BIOS is a large job. UEFI cannot just be added to a BIOS. The BIOS has to be developed using UEFI base code.
    Insyde Software sells BIOS source code to PC manufacturers who modify the source code to meet their specific BIOS needs. Thus, each PC manufacturer has a unique BIOS. Insyde does not track the changes made to the BIOS by the PC manufacturer because the PC manufacturer has full control over the BIOS features.
    The bottom line is that it is basically impossible to add UEFI to an existing BIOS. The BIOS must be developed using UEFI technology and it appears that HP is not supporting UEFI in the notebook you have.
    Regards,
    Ed"

    Me:

    Hello, Edwin
    Thank you for your reply, i sent same message to HP also. They didnt answer me yet. This shows how Firms are looking their costumers.


    But I think you got me wrong. Because as i said in my first message, there is already UEFI implemented in my Notebook. As HP says “Some PCs pre-installed with Windows 7 contain UEFI technology and can be modified to deliver these features.” No need to develop UEFI. I just want to activate it. If you want i can attach the bios file, so you can tell me if its possible to activate it or not? Actually i dont understand why HP doesnt want to support. My guess is my notebook is without warranty. I bought it 3 years ago.


    Anyway, you can just tell me what modules i have to activate in my bios file? Any help from you will be very very appreciated. Because there are so many ppl trying to get help about UEFI support on their notebooks those are already implemented in the Bios. I can address some forums that show ppl trying to activate UEFI support on Insyde H2O bioses. There is already an option to enable UEFI in my Bios setup but some modules missing. Maybe we can get those modules from a newer bios file but i think asking to Insyde Software is an easy way to learn.


    I am waiting to hear from you, again. Thanks anyway. Have a good day.

    Insyde:
    "We unfortunately cannot provide any support on this issue. The manufacturer of your computer will be the best resource for this type of support.


    Thank you for contacting Insyde Software."
     
  13. Yen

    Yen Admin
    Staff Member

    May 6, 2007
    11,171
    10,927
    340
    #16 Yen, Jul 31, 2014
    Last edited: Jul 31, 2014
    "Actually i dont understand why HP doesnt want to support."
    Are you serious? :biggrin:
    HP is known to have whitelists which allow only some devices to run and they ENCRYPT / sign the EFI, why do you think they restrict???

    In fact they don't care about the consumer, they want your money and they want that you only run what they want!!!!
    The last thing they want is that you become able to modify their EFI!!!

    It sounds like they have not understood what you wanted to ask (probably with intent), to add GPT boot to your current BIOS. They wrote "UEFI cannot just be added to a BIOS." This sounds odd. It's like to say Android cannot just be added to Windows. We're talking about the ability to boot GPT ('UEFI') partitions.

    Besides of this tech challenge which rocks, one should ask oneself generally: Why do I need 'UEFI support' myself??? It is actually useless and has no real advantage.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  14. Krutonium

    Krutonium MDL Senior Member

    Aug 27, 2013
    406
    281
    10
    Because we can.
     
  15. Tito

    Tito Super Mod / Adviser
    Staff Member

    Nov 30, 2009
    17,574
    15,381
    340
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...