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)
  • LK (MediaTek)
  • FBPK Containers (Google)
  • DHTB Signed binaries (U-Boot)
  • 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


Using as a CLI tool:

  1. Installing:
# With PyPi (recommended)
pip install fasboot_oem_extractor
# From source/clone
pip install -r requirements.txt
  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 file (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 sparse 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 is one public function:

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

# commands = extract_commands(Path("./abl.elf"))
commands = extract_commands("./abl.elf")

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.


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.0.2

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.0.2
File Size Uploaded
fastboot_oem_extractor-1.0.2.tar.gz 10.5 kB Details

Built distribution (wheel)

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

Total release size: 21.8 kB

Release files / fastboot_oem_extractor-1.0.2.tar.gz

Download URL fastboot_oem_extractor-1.0.2.tar.gz
Size 10.5 kB
Tags Source
SHA-256 checksum
How to use checksums
4f7d7a8c2d42b9f73fcd849ae4f54053cf354cec9ad95ed0d79444f0cb29faab
BLAKE2b-256 checksum
How to use checksums
012f620efcbe9b42532a189660571a1eaff25e95ea53acf7e77dec5a9d6d6349
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 17, 2026.

Transparency log

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

Download URL fastboot_oem_extractor-1.0.2-py3-none-any.whl
Size 11.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ee5255bdd18c915fcfa6d19873ef8eb2eddf2c57693cef73bda0dc5055579ac9
BLAKE2b-256 checksum
How to use checksums
0f303d78517086f067e0e8c059492e23651d3402f629bee8035c21a216d9b4a3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 17, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.0.2 This release

2 release files

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