Reverse Engineeringfirmwarebiosflashchipprogrammerspilpccoreboot

flashrom

flashrom identifies, reads, writes, verifies, and erases BIOS/ROM/flash chips. It supports in-system flashing on mainboards and external devices like network cards and programmers.

Description

flashrom is a utility for handling flash chips commonly used in BIOS/EFI/coreboot/firmware/optionROM images. It enables users to flash proprietary BIOS images or open-source alternatives like coreboot directly on supported mainboards. The tool also reads existing BIOS/firmware from chips for backup or analysis.

Common use cases include updating or replacing firmware on motherboards, network cards (NICs), SATA controllers, and graphics cards. It supports external flashing via various hardware programmers, making it versatile for hardware hacking and firmware reverse engineering.

flashrom detects a wide range of chip packages such as DIP32, PLCC32, SO8, and BGA using protocols like LPC, FWH, parallel flash, or SPI. This broad compatibility positions it as an essential tool for low-level system modification and recovery.

How It Works

flashrom probes for supported flash chips using specified programmers like internal (mainboard), external USB devices (ft2232_spi, ch341a_spi), or serial adapters (serprog). It communicates via protocols including SPI, LPC, FWH, and parallel flash to read chip contents, erase sectors, program new data, and verify integrity. Programmers handle hardware-specific access, such as /dev/spidev for Linux SPI or DDC for displays.

Installation

bash
sudo apt install flashrom

Flags

-h | --helpprint this help text
-R | --versionprint version (release)
-r | --read [<file>]read flash and save to <file>
-w | --write [<file>|-]write <file> or the content provided on the standard input to flash
-v | --verify [<file>|-]verify flash against <file> or the content provided on the standard input
-E | --eraseerase flash memory
-p | --programmer <name>[:<param>]specify the programmer device. One of internal, dummy, nic3com, nicrealtek, gfxnvidia, etc.

Examples

Display the help text and usage information for flashrom
flashrom -h
Read the current flash contents and save to backup.rom file
flashrom -r backup.rom
Write newbios.rom file to the flash chip
flashrom -w newbios.rom
Verify the flash contents against newbios.rom file
flashrom -v newbios.rom
Erase the entire flash memory
flashrom -E
Use internal programmer for in-system flashing on mainboard
flashrom -p internal
Use FT2232-based USB SPI programmer
flashrom -p ft2232_spi
Probe for flash chips without performing any operation
flashrom
Updated 2026-04-16kali.org ↗