Files
reverse-engineering-anything/tests/conformance/esp/bootloader.c
T
Entrpi 546119b63e feat(artifacts): inventory and extract ESP32 firmware images
ESP32-family app and bootloader images (magic 0xE9) had no reader, so
open_binary refused OTA downloads, app partitions and bootloaders.

Add the esp-image container format behind inspect_artifact and
extract_artifact. A pure decoder reads each byte once and keeps only
fixed-size fields. Derived facts cover the chip, from a table cited to
ESP-IDF v6.1; segment classification as ESP-IDF's should_map and
should_load; checksum and appended SHA-256 results; app and bootloader
descriptors; Secure Boot v2 signature blocks, observed and unverified;
and undescribed trailing byte ranges. Truncation and undescribed bytes
make coverage unknown. ESP8266 images are refused with a specific
reason, and ciphertext stays unrecognized.

Add the format to every target, Evidence, snapshot, live-summary and
artifact vocabulary, document it, and add an optional verify:esp-images
lane that compares esptool-built images with esptool image-info and
espsecure signature-info-v2.

Refs #3615
2026-10-27 22:54:29 +11:00

33 lines
840 B
C

#include <stdint.h>
/* esp_bootloader_desc_t layout from ESP-IDF v6.1 esp_bootloader_desc.h. */
typedef struct {
uint8_t magic_byte;
uint8_t reserved[2];
uint8_t secure_version;
uint32_t version;
char idf_ver[32];
char date_time[24];
uint8_t reserved2[16];
} rea_bootloader_desc_t;
_Static_assert(sizeof(rea_bootloader_desc_t) == 80,
"esp_bootloader_desc_t is 80 bytes");
__attribute__((section(".dram0.bootdesc"), used))
const rea_bootloader_desc_t rea_bootloader_desc = {
.magic_byte = 80,
.secure_version = 2,
.version = 7,
.idf_ver = "v6.1-rea",
.date_time = "Jan 1 2026 00:00:00",
};
__attribute__((section(".dram0.data"), used)) volatile int rea_counter = 7;
__attribute__((section(".iram_loader.text"), used, noreturn)) void
rea_entry(void) {
for (;;)
rea_counter += 1;
}