Skip to main content

fastboot-oem-extractor

PyPI - Version PyPI - Downloads PyPI - Typing

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)
  • DHTB Signed binaries (U-Boot)
  • LK, BFBF, SSSS (MediaTek)
  • FBPK Containers (Google)
  • ELF Linux 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:

  1. Prepare your firmware images from the internet, or by pulling them off the device with adb
  2. Run the installed CLI against the image
# PyPi
python -m fastboot_oem_extractor ./abl.elf
# Source/clone
python ./extractor.py ./abl.elf
  1. 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:

--force-string-lookup

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) -> 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.
  • Returns:
    • True if the file has no recognized magic bytes or UEFI headers.
    • False otherwise.
  • Raises: OSError if the file cannot be read.
# Extract unique 'fastboot oem' commands from a firmware image
extract_commands(firmware_file, force_string_lookup=False) -> 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 to False.
  • Returns:
    • A sorted list of unique command strings when the format is recognized.
    • An empty list if no commands are found.
    • None if the format is unrecognized and force_string_lookup is False.
  • Raises: OSError if the file cannot be read.

Quick example:

# from pathlib import Path
from fastboot_oem_extractor import 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)

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:

chkndrp/imagefv-extractor


Requirements

  • Python 3.10 or newer
  • Installed uefi_firmware pip package

Metadata

Release files for fastboot-oem-extractor 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fastboot-oem-extractor 1.1.0
File Size Uploaded Provenance Actions
fastboot_oem_extractor-1.1.0.tar.gz 11.7 kB With provenance Details for fastboot_oem_extractor-1.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for fastboot-oem-extractor 1.1.0
File Interpreter ABI Platform Actions
fastboot_oem_extractor-1.1.0-py3-none-any.whl Python 3 none any Details for fastboot_oem_extractor-1.1.0-py3-none-any.whl

Total release size: 23.8 kB

Release files / fastboot_oem_extractor-1.1.0.tar.gz

Download URL fastboot_oem_extractor-1.1.0.tar.gz
Size 11.7 kB
Tags Source
SHA-256 checksum
How to use checksums
a96973e827d4c93fd727ea3c3c4c7fb2697ed6d4cf125c9d02624a8292af3ca7
BLAKE2b-256 checksum
How to use checksums
320046346e63421bc8d3e961bf4a6c64667cbc4e03f618e638ab47a7f4af1d2e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 29, 2026.

Transparency log

Release files / fastboot_oem_extractor-1.1.0-py3-none-any.whl

Download URL fastboot_oem_extractor-1.1.0-py3-none-any.whl
Size 12.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0918d26afe9c2eaa396af66bf8e368b8fdda85bd409eb193fdf2775fa9b2b4b7
BLAKE2b-256 checksum
How to use checksums
b6d7eec9c46ce2752185ce788cae98c8440af2bc60f893a15ba9bf2fb03c2a93
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 29, 2026.

Transparency log

Security for fastboot-oem-extractor 1.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for fastboot_oem_extractor-1.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 29, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page