ECU Firmware Dumps: Intel HEX and S-Record
Explanation of ECU firmware dumps, the structure of Intel HEX and S-Record formats, and the use of srec_cat for technical analysis.
Key points
A firmware dump is a copy of the data stored in a microcontroller or ECU memory. In the automotive sector, these files are analyzed using reverse engineering techniques to understand software behavior. Intel HEX and S-Record formats facilitate their exchange, and tools like srec_cat simplify technical management.
What is a firmware dump in the automotive context
A firmware dump is a copy of the data stored in the memory of a microcontroller or electronic control unit (ECU). In the automotive sector, these dumps are used to analyze software through reverse engineering techniques, allowing for an understanding of vehicle control system behavior.
Extracting and analyzing firmware in ECUs requires specific techniques to overcome access protections and read memory content. This process is fundamental for security research and for studying communication protocols and bootloaders embedded in on-board systems.
Section references: Recovering an ECU firmware using disassembler and branches ↗ · Automotive Firmware Extraction And Analysis Techniques ↗
- Copy of software data from a microcontroller or ECU.
- Used in automotive reverse engineering and security analysis.
- Allows studying diagnostic protocols and embedded bootloaders.
Intel HEX format structure
The Intel HEX format is one of the most common for representing binary program data using hexadecimal ASCII characters. It organizes the file into records, typically one per line, which begin with a colon (:) character as a record marker.
The general structure of an Intel HEX record comprises the marker, data length, address, record type, data or argument, and a checksum. The checksum is calculated as the two's complement of 8 bits of the sum of the bytes from the length field to the last data or argument byte. The format defines six record types, including data, end of file, and extended addresses.
Section references: 2.2 Intel HEX file Specification ↗
- Records starting with a colon (:) and containing hexadecimal ASCII data.
- Structure: marker, length, address, type, data, and checksum.
- Checksum: two's complement of 8 bits of the sum of bytes from the length.
- Six defined record types, including data and end of file.
Using srec_cat to manage dumps
The srec_cat tool, part of the srecord package, allows gathering input files into a single output file and applying filters during the process to perform significant manipulations. It supports several input formats, with the default format indicated by its manual being Motorola S-Record.
It is important to note that Intel HEX uses byte addresses, but in some microcontroller families, programming uses word addresses. In these cases, it may be necessary to map the file addresses to the device addresses to avoid errors in the analysis or programming process.
Section references: 2.2 Intel HEX file Specification ↗ · srec_cat(1) — srecord ↗
- Gathers input files into a single output file.
- Allows applying filters to manipulate data.
- Supports multiple formats; the default is Motorola S-Record.
- Verify address mapping (byte vs. word) according to the microcontroller.
Use case: analysis of an ECU with STM32F7
In a case documented by Quarkslab in 2024, a shared fleet ECU based on an STM32F7 (ARM) microcontroller connected to a CAN transceiver was analyzed. The RDP (Readout Protection) was set to level 1, which blocked direct access to the flash memory via the SWD interface.
The researchers recovered the content of the ECU's eMMC memory by connecting an SD adapter to the CMD, CLK, and DAT0 signals and stopping the microcontroller via SWD/OpenOCD before reading it. This example illustrates the complexity of firmware extraction in modern ECUs, where hardware protections require specific physical access techniques to the components.
Section references: Recovering an ECU firmware using disassembler and branches ↗
- ECU with STM32F7 microcontroller and CAN transceiver.
- Level 1 RDP protection blocked SWD access to flash memory.
- Recovery of eMMC memory content through physical access.
What is a firmware dump?
It is a copy of the software data stored in the memory of a microcontroller or ECU, used for analysis and reverse engineering.
How is an Intel HEX record structured?
It starts with a colon (:) and contains the length, address, record type, data, and a checksum calculated as the two's complement of 8 bits.
What does the srec_cat tool do?
It allows gathering input files into a single output file and applying filters. It supports multiple formats, with Motorola S-Record being the default.
Why is the checksum important in Intel HEX?
The checksum verifies the integrity of the data in each record. It is calculated as the two's complement of 8 bits of the sum of the bytes from the length to the last data.


