HackBGRT Documentation

repository·main·Indexed 25 days ago

https://github.com/metabolix/hackbgrt

A UEFI-based boot logo changer for Windows that overwrites the vendor-defined Boot Graphics Resource Table (BGRT). It includes a setup utility for Windows, batch installation commands, and support for custom BMP images. The documentation covers installation prerequisites, Secure Boot configuration via shim and MOKManager, multi-boot system setup, and detailed configuration options via config.txt.

Tokens
2.2K
Snippets
0
Records
12
Agent score
83%

What's inside HackBGRT

  1. Enroll HackBGRT hash from disk (Safest Method)

    main

    To trust only a specific version of HackBGRT, use the Enroll hash from disk option in MOKManager. This is the recommended security practice.

    Steps:

    1. In the MOK management menu, select Enroll hash from disk and press Enter.
    2. Select your disk and press Enter.
    3. Navigate the directory structure to find the HackBGRT binary. Typically, the path is EFI/HackBGRT/grubx64.efi.
    4. Select grubx64.efi and press Enter.
    5. (Optional) Select View key 0 to verify the SHA256 hash.
    6. Select Continue and press Enter.
    7. When prompted Enroll the key(s)?, select Yes and press Enter.
    8. Select Reboot from the main menu to finish.
  2. Install HackBGRT on Windows

    main

    To install HackBGRT for changing the UEFI boot logo on Windows:

    1. Pre-requisites:
      • Ensure you have only one bootable hard drive to avoid automatic setup failure.
      • Warning: Create a rescue disk before proceeding. Misconfiguration can make your system unbootable.
      • TPM/Security: Disable BitLocker, Windows PIN unlock, or other TPM-dependent security features before installation.
      • Secure Boot: If Secure Boot is enabled, you must follow the manual steps in shim.md to trust the HackBGRT loader.
    2. Installation Steps:
      • Download the latest release.
      • Run setup.exe as an administrator.
      • Follow the on-screen instructions.
      • The installer may launch Paint to edit the image; otherwise, you can edit it manually.
      • For advanced settings, edit config.txt before running the installer.
    3. Post-Installation:
      • Reboot your computer.
      • If Windows restores the original boot loader later, simply reinstall HackBGRT.
  3. Configure HackBGRT for Multi-boot Systems

    main

    If you are not using a standard Windows-only setup, use these methods:

    Windows-only (without overwriting bootloader):

    1. Run setup.exe and choose to install files without enabling them.
    2. Manually configure your boot loader to start \EFI\HackBGRT\loader.efi.

    Multi-OS (e.g., Linux + Windows):

    1. Configure HackBGRT to point to your other boot loader (e.g., boot=\EFI\systemd\systemd-bootx64.efi).
    2. Run setup.exe and install as a new EFI boot entry.

    Linux-only:

    1. Run setup.exe dry-run.
    2. Manually copy the files from the dry-run/EFI directory to your [EFI System Partition]/EFI directory.
  4. Enroll HackBGRT certificate key from disk

    main

    To trust any binary signed with the HackBGRT certificate, use the Enroll key from disk option. Note that this trusts anything signed by the same certificate.

    Steps:

    1. In the MOK management menu, select Enroll key from disk and press Enter.
    2. Select your disk and press Enter.
    3. Navigate the directory structure to find the certificate file. Typically, the path is EFI/HackBGRT/certificate.cer.
    4. Select certificate.cer and press Enter.
    5. (Optional) Select View key 0 to verify the certificate details (Issuer: CN=HackBGRT Secure Boot Signer, O=Metabolix).
    6. Select Continue and press Enter.
    7. When prompted Enroll the key(s)?, select Yes and press Enter.
    8. Select Reboot from the main menu to finish.
  5. Configure shim for Secure Boot after HackBGRT installation

    main

    When Secure Boot is enabled, the first boot after installing HackBGRT will trigger a "Verification failed" error. You must use the MOKManager tool (provided by shim) to trust the HackBGRT binaries.

    Follow these steps to enter the configuration tool:

    1. On the "Verification failed: (0x1A) Security Violation" error screen, select OK and press Enter.
    2. When the screen says "Press any key to perform MOK management", press a key quickly to enter the MOKManager program.
  6. Configure HackBGRT Images

    main

    HackBGRT uses images to display during boot.

    • Single Image: Edit the splash.bmp file in the installer folder.
    • Multiple Images: Edit config.txt to define multiple image paths. One will be picked at random during boot.
    • Custom Formats: If using non-BMP files (e.g., my.jpg), copy the file to the installer folder and set path=my.jpg in config.txt before running the installer.
    • Manual ESP Installation: If copying images manually to the EFI System Partition (ESP), the image must be a 24-bit BMP file with a 54-byte header (TrueColor BMP3).
  7. Manually install shim (x64)

    main

    If you need to install the shim boot loader manually for an x64 architecture, follow these steps:

    1. Obtain shim (preferably shim-signed).
    2. Rename your existing boot loader to grubx64.efi.
    3. Copy shimx64.efi to the location where your original loader was located.
    4. Copy mmx64.efi (MOKManager) to the same folder as shimx64.efi.

    Boot Process Logic:

    • The system starts shimx64.efi (which you renamed to your loader's name).
    • shim attempts to load grubx64.efi.
    • If grubx64.efi is not trusted, shim launches mmx64.efi to allow MOK management.
  8. Perform a Quiet (Batch) Installation

    main

    You can automate the installation using setup.exe batch COMMANDS. This is useful for pre-configuring images and settings before deployment. Run the command as an administrator.

    Common Batch Commands:

    • install – Copy files without enabling them.
    • enable-bcdedit – Use bcdedit to create a new EFI boot entry.
    • disable-bcdedit – Use bcdedit to disable the EFI boot entry.
    • enable-entry – Write to NVRAM to create a new EFI boot entry.
    • disable-entry – Write to NVRAM to disable the EFI boot entry.
    • enable-overwrite – Overwrite the MS boot loader.
    • disable-overwrite – Restore the MS boot loader.
    • skip-shim – Skip shim during installation.
    • allow-secure-boot – Ignore Secure Boot in subsequent commands.
    • allow-bitlocker – Ignore BitLocker in subsequent commands.
    • allow-bad-loader – Ignore bad boot loader configuration in subsequent commands.
    • disable – Runs all relevant disable-* commands.
    • uninstall – Disables and removes HackBGRT completely.
    • show-boot-log – Shows the debug log (requires log=1 in config.txt).
    • arch=... – Force a specific architecture.
    • esp=... – Force a specific EFI System Partition path.
    • dry-run – Skips actual changes (useful for testing).
  9. Configure HackBGRT via config.txt

    main

    HackBGRT reads its configuration from a file named config.txt located in its working directory or the default directory \EFI\HackBGRT. If no command line arguments are provided via the UEFI Shell, the application will attempt to read this file.

    Common configuration settings include:

    • debug: Enables/disables debug logging.
    • log: Enables/disables persistent logging.
    • resolution_x / resolution_y: Target screen resolution.
    • image.path: Path to the BMP image to use.
    • image.action: Action to take with the BGRT (e.g., REPLACE, REMOVE, KEEP).
    • image.orientation: Orientation of the image.
    • image.x_mode / image.y_mode: Coordinate positioning mode (KEEP, CENTERED, or absolute).
    • boot_path: Custom path to the bootloader if the default Microsoft bootloader cannot be used.
  10. Troubleshoot HackBGRT Boot Issues

    main

    Common issues and solutions:

    • BCDEdit failed: Try the other installation option in the menu. If that fails, check bcdedit /enum firmware in Command Prompt to identify errors (e.g., antivirus interference or disk errors).
    • Verification failed / Security violation: This occurs on first boot with Secure Boot. Refer to shim.md to manually trust the loader.
    • Boot is slow or stuck: The first boot may take several minutes. Wait patiently or try rebooting a few times.
    • Image not visible / Nothing happens:
      • Run setup and select the option to check the boot log (BOOT LOG START).
      • If log is empty: The computer's security features may be resetting the BootOrder. Run setup, select "boot to UEFI setup", and manually set HackBGRT as the default boot entry in your BIOS/UEFI settings.
      • If log is not empty: The issue is likely in config.txt or the image. Try the default configuration/image first to isolate the problem.
    • Impossible to boot:
      • If using the default method: Use your computer's hotkey during power-on to enter UEFI Setup and select Windows Boot Loader to bypass HackBGRT.
      • If using the legacy method (overwriting MS boot loader): You must use a Windows installation/recovery disk to repair the bootloader.
  11. Understand HackBGRT boot failure and recovery

    main

    If HackBGRT fails to start the next boot image, it will display a failure message and dump the log.

    Recovery Steps:

    1. If the screen shows HackBGRT has failed, it will attempt to dump the log and wait 15 seconds before exiting.
    2. If you cannot boot into Windows, you must use an installation or recovery disk to repair your boot configuration.
    3. During a successful boot transition, HackBGRT provides a 15-second window where you can press ESC to cancel the boot process if something seems wrong.
  12. HackBGRT default directory structure

    main

    The application looks for its configuration and assets in the following locations:

    • Default Directory: \EFI\HackBGRT
    • Working Directory: The directory from which the HackBGRT EFI application was loaded.

    It specifically looks for config.txt and the BMP image specified in the configuration within these directories.