All Projects → Jamesits → BGRTInjector

Jamesits / BGRTInjector

Licence: BSD-2-Clause license
Customize Windows 10 boot logo without modifying UEFI firmware.

Programming Languages

c
50402 projects - #5 most used programming language
Makefile
30231 projects
VBScript
123 projects

Projects that are alternatives of or similar to BGRTInjector

WPBT-Builder
The simple UEFI application to create a Windows Platform Binary Table (WPBT) from the UEFI shell.
Stars: ✭ 72 (+84.62%)
Mutual labels:  uefi, acpi
biefircate
Running x86-16 or x86-32 code from x86-64 UEFI; _very experimental_ • mirror of https://gitlab.com/tkchia/biefircate • developer notes at https://gitlab.com/tkchia/biefircate/-/blob/main/doc/NOTES.asciidoc
Stars: ✭ 47 (+20.51%)
Mutual labels:  uefi, acpi
PrimeG2Pkg
Running Windows on smartphone is not new. How about a calculator?
Stars: ✭ 68 (+74.36%)
Mutual labels:  uefi, acpi
bootutils
Utilities to create bootable disks, remaster ISO images, make multiboot ISO images
Stars: ✭ 18 (-53.85%)
Mutual labels:  uefi
Tow-Boot
An opinionated distribution of U-Boot. — https://matrix.to/#/#Tow-Boot:matrix.org?via=matrix.org
Stars: ✭ 338 (+766.67%)
Mutual labels:  uefi
MetalOS
Homebrew x64 OS written in C++ that runs Doom!
Stars: ✭ 33 (-15.38%)
Mutual labels:  uefi
pipxe
iPXE for the Raspberry Pi
Stars: ✭ 154 (+294.87%)
Mutual labels:  uefi
Hackintosh-ASUS-A455LF-Notebook
EFI Folder for ASUS A455LF-WX039D Notebook Series with Clover/OpenCore Legacy or UEFI
Stars: ✭ 27 (-30.77%)
Mutual labels:  uefi
CloverEFI-4MU
Manually install Clover EFI Bootloader via Linux System on Legacy BIOS or UEFI Firmware.
Stars: ✭ 93 (+138.46%)
Mutual labels:  uefi
daintree
ARMv8-A/RISC-V kernel (with UEFI bootloader)
Stars: ✭ 32 (-17.95%)
Mutual labels:  uefi
mu oem sample
Project Mu OEM Sample Code
Stars: ✭ 27 (-30.77%)
Mutual labels:  uefi
UEFTW
Random UEFI toys
Stars: ✭ 18 (-53.85%)
Mutual labels:  uefi
sicherboot
Unmaintained systemd-boot integration with secure boot support; consider https://github.com/Foxboron/sbctl instead.
Stars: ✭ 31 (-20.51%)
Mutual labels:  uefi
boot2flappy
Flappy Bird as bootable UEFI executable
Stars: ✭ 48 (+23.08%)
Mutual labels:  uefi
jsix
A hobby operating system for x86_64, boots with UEFI.
Stars: ✭ 60 (+53.85%)
Mutual labels:  uefi
UefiToolsPkg
Various useful utilities for UEFI
Stars: ✭ 87 (+123.08%)
Mutual labels:  uefi
meta-secure-core
OpenEmbedded layer for the use cases on secure boot, integrity and encryption
Stars: ✭ 80 (+105.13%)
Mutual labels:  uefi
efi
Ergonomic Rust framework for writing UEFI applications.
Stars: ✭ 44 (+12.82%)
Mutual labels:  uefi
AiliceOS
AiliceOS: Build an x86_64 and UEFI OS using Rust
Stars: ✭ 59 (+51.28%)
Mutual labels:  uefi
SmmExploit
The report and the exploit of CVE-2021-26943, the kernel-to-SMM local privilege escalation vulnerability in ASUS UX360CA BIOS version 303.
Stars: ✭ 98 (+151.28%)
Mutual labels:  uefi

BGRTInjector

Changes the boot screen image on a UEFI computer.

This is a remake of Ben Wang's windows_custom_loader.efi, the source code of which is long lost. Several incompatibilities with non-Apple UEFI implementations are addressed, and you can now replace the logo without recompiling the whole program.

Requirements

  • UEFI firmware (some old EFI firmwares might be supported as well)
  • An operating system that reads BGRT table (reads: Windows 8.1 or later)

Installation

Run BGRTInjector.efi either manually or automatically before your OS loads. You need to disable Secure Boot or sign it on your own, obviously.

Installation on rEFInd

Put a release build of BGRTInjector.efi (driver mode) into ESP:\EFI\refind\drivers_x64 and reboot.

Installation without 3rd-party bootloader

Put a release build of BGRTInjector.efi (Windows loader mode) into your ESP volume and set it as the default loader. This can be achieved by putting it to ESP:\EFI\boot\bootx64.efi. (Firmware on some devices will load Windows first which is a violation of the UEFI standard. You might need to manually register a UEFI boot entry on these systems.)

Usage

Customize the image

To customize the image, put a 24-bit (other modes and formats are not supported) BMP image named boot_image.bmp into the root directory of your ESP volume (right beside the EFI directory). If BGRTInjector complains about image file size incorrect, please open the BMP image in mspaint.exe then save it to fix its header.

The image will be displayed on the center of the screen, 1:1 pixel aligned. If the image is larger than the default UEFI GOP resolution, it will not be displayed.

Change the built-in default image

Convert a 24-bit BMP image to C-style array initializer, replace default_boot_image.bmp.inc and compile. To do the convertion you can use bin2array:

python3 bin2array.py -O default_boot_image.bmp.inc your_image.bmp

Security

Loading untrusted image into memory is dangerous. BGRTInjector only reads the image file from the volume (partition) it lives in, and ESP partition is usually protected under end-user accessible operating systems, so we can assume only a system administrator or a evil maid can load an evil image. Additionally BGRTInjector does some basic sanity checks on the image file, but it is still prone to specially crafted evil images.

If you are not signing your own Secure Boot keys, using BGRTInjector means Secure Boot will be unavailable. In Windows loader mode, BGRTInjector does not verify the authenticity of the target bootloader.

FAQ

Stuck at loading boot image from disk

You have too many hard disks or the NTFS driver comes with rEFInd is causing a hang. Delete ESP:\EFI\refind\drivers_x64\ntfs_x64.efi and other filesystem drivers if you don't need them.

Image is not centered

This typically happens when you are using driver mode and your firmware does not set GOP resolution to the max available value. All the drivers are launched prior to rEFInd setting the GOP resolution, so BGRTInjector would read a smaller screen resolution.

The most simple solution:

  • Remove BGRTInjector from drivers_x64 folder
  • Download a Windows loader mode BGRTInjector and put it under ESP:\
  • Hard code the resolution you need in rEFInd's config file
  • Either tell rEFInd not to switch to text mode before loading OS, or disable graphics mode (full screen logo display) in your BIOS

Here's a rEFInd config from my computer for reference.

# Your resolution may vary
resolution 3840 2160

menuentry "Windows 10 (BGRT Injected)" {
    # do not switch to text mode when booting; otherwise screen resolution will still be incorrect
    graphics on

    icon \EFI\refind\icons\os_win8.png

    # use BGRTInjector Windows loader mode 
    loader \BGRTInjector.efi
}

Building

Flags:

  • _DEBUG: debug output and more pauses to see the log on the screen.
  • LOAD_WINDOWS: use Windows loader mode if set, otherwise use driver mode. In Windows loader mode, it will automatically search for EFI\Microsoft\Boot\bootmgfw.efi and start it after BGRT table has been injected. In driver mode, it quits after BGRT table has been injected.
  • VERTICAL_ALIGN_RATIO and HORIZONTAL_ALIGN_RATIO: a float number between 0 and 1 to indicate where to put the image on the screen.

Notes:

  • In theory it supports common CPU architectures, but non-amd64 ones have not been tested; contributions are welcomed

Windows

Requirements:

  • Visual Studio 2022 or higher
  • C++ desktop development tools
  • MSVC C++ build tools (for architectures you need)
  • MSVC C++ Spectre-mitigated libs (for architectures you need)
  • QEMU

Open BGRTInjector.sln in Visual Studio and click Build Solution.

Linux

Install mingw-w64 plus the usual C/C++ development packages, then run make. Linux build procedures are not extensively tested, so your mileage may vary.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].