chkndrp/fastboot-oem-extractor
chkndrp/fastboot-oem-extractor has 64 GitHub stars and 6 forks. GitHot measured 0 stars in 24 hours. Last checked 2026-11-15 06:17 UTC. Last push 2026-11-13.
Measured star growth
- in 24h
- 0
- in 7 days
- Collecting history
- in 15 days
- Collecting history
- in 1 month
- Collecting history
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
About
Extract hidden "fastboot oem" commands from firmware blobs
Developer ToolsREADME.md
Originalfastboot-oem-extractor
Extract hidden "fastboot oem" commands from firmware blobs
Supported firmware
These firmware blobs will be accepted by this tool
ABL(Qualcomm)LK1st, LK2nd(Qualcomm, Second BLs)DTB, FDT, FIT(Device trees, U-Boot)DHTBSigned binaries (U-Boot)LK, BFBF, SSSS(MediaTek)FBPKContainers (Google)ELFLinux binaries- Anything else containing UEFI PEs
This is an artificial barrier for when this tool is ran in a loop against firmware images
Installing:
# With PyPi (recommended)
pip install fastboot_oem_extractor
# When running from source/clone
pip install -r requirements.txt
Using as a CLI tool:
- Prepare your firmware images from the internet, or by pulling them off the device with
adb - Run the installed CLI against the image
# PyPi
python -m fastboot_oem_extractor ./abl.elf
# Source/clone
python ./extractor.py ./abl.elf
- Fetch the output
# Example output for Redmi Note 14 Pro+ 5G (amethyst)
(x) File contains common bootloader magic bytes
(x) Reading firmware image (first 10MB): abl.elf
(x) Found valid UEFI firmware structure at offset: 0x1000
(x) Extracting firmware...
(x) Found 1 UEFI portable executable(s)
(x) Matching 'oem *' ascii strings
fastboot oem allow-wipe-userdata
fastboot oem audio-framework
fastboot oem device-info
fastboot oem disable-charger-screen
fastboot oem dm-verity-enforcing
fastboot oem edl
fastboot oem enable-charger-screen
fastboot oem fbreason
fastboot oem getguid
fastboot oem hwid
fastboot oem lkmsg
fastboot oem lock
fastboot oem lpmsg
fastboot oem off-mode-charge
fastboot oem poweroff
fastboot oem ramdump fat
fastboot oem select-display-panel
fastboot oem set-gpu-preemption
fastboot oem set-hw-fence-value
fastboot oem uart-enable
fastboot oem uefilog
fastboot oem unlock
If your file is some raw image that does not contain any UEFI PEs or common binary magic bytes, you can force the string lookup via this command line option:
-f, --force-string-lookup
For firmware embedded after a prefix in a larger image (e.g. partition dump, special), specify its starting byte offset in decimal or hexadecimal:
-o, --offset
You can also route the clean fastboot command output to a file using this command line option:
-O, --output
Using as a Python library
This project can also be used as a library for other tools that want to integrate this. There are two public functions:
# Check if a firmware image has no known magic bytes or UEFI structures
is_raw_image(
firmware_file: str | pathlib.Path,
offset: int = 0
) -> bool:
This function is intended to help determine whenever to use
force_string_lookup when calling extract_commands()
firmware_file(str | pathlib.Path): Path to the firmware image.offset(int): Byte offset at which the firmware image starts. Defaults to0.- Returns:
Trueiffirmware_filehas no recognized magic bytes or UEFI headers.Falseotherwise.
- Raises:
OSErroriffirmware_filecannot be read.ValueErroriffirmware_fileis notstrorpathlib.Path, oroffsetis not a non-negativeintwithin the file size.
# Extract unique 'fastboot oem' commands from a firmware image
extract_commands(
firmware_file: str | pathlib.Path,
force_string_lookup: bool = False,
offset: int = 0
) -> list[str] | None:
firmware_file(str | pathlib.Path): Path to the firmware image.force_string_lookup(bool): Force the oem command string lookup on raw images. Defaults toFalse.offset(int): Byte offset at which the firmware image starts. Defaults to0.- Returns:
- A sorted list of unique command strings when the format is recognized.
- An empty list if no commands are found.
Noneif the format is unrecognized andforce_string_lookupisFalse.
- Raises:
OSErroriffirmware_filecannot be read.ValueErroriffirmware_fileis notstrorpathlib.Path,force_string_lookupis not abool, oroffsetis not a non-negativeintwithin the file size.
Quick example:
# from pathlib import Path
from fastboot_oem_extractor import is_raw_image, extract_commands
# israw = is_raw_image(Path("./abl.elf"))
israw = is_raw_image("./abl.elf")
# commands = extract_commands(Path("./abl.elf"))
commands = extract_commands("./abl.elf", force_string_lookup=israw)
# commands = extract_commands(Path("./abl.elf"), offset=0x100000)
if commands is None:
print("Unrecognized firmware format.")
elif commands:
print(commands)
# Example output: ['fastboot oem allow-wipe-userdata', ...]
else:
print("No OEM commands found.")
Disclaimer:
Due to the nature of simply matching "oem" strings, the output may contain some invalid commands, or commands that don't work after the device is sent out of factory. Keep this in mind
Also, some FBPK containers (e.g. barbret bootloader) are very difficult to extract
oem commands from, and may not work. Most work just fine though.
This project is always tested with chkndrp/test-bootloader-images prior to being released
Similar project
If you want to extract bootloader/charging pictures from a imagefv partition on your Qualcomm device,
use my other tool:
Requirements
- Python 3.10 or newer
- Installed
uefi_firmwarepip package