[ESP32] Browser-based firmware editor

While writing the title of that post, a cold shower ran down my back. Hell, what have I been doing lately? With a generous amount of GitHub Copilot credits, I’ve been sliding deeper into vibe coding.

That said, writing the same crap for the thirteenth time is exhausting. With help from Claude or Codex, my copilot now simplifies reverse-engineering tasks far beyond what I expected. When I know exactly how I want to parse a specific part of a firmware image, I can instruct that co-hacker to produce the required code in seconds, while I work on the next thing. Or just watch a movie.

This accelerates work in a way that’s hard to overstate. Years ago, “fixing someone’s firmware image” meant hours of work for a single bug. I still spend hours today – but I usually end up not only fixing the issue, but also building a reusable tool that speeds up the next job.

Yesterday was a good example. A failed ESP32 firmware patch turned into a feature-rich firmware image editor, capable of working on full .bin images as well as directly on-chip via USB-JTAG or a UART adapter.

You can find it here:
https://github.com/g3gg0/esp32_flasher

Live Version:
ESP32 Firmware Viewer

Oh, and yes, you need Chrome or Edge to use the serial port.

AI generated description:

Parsers & Analysis

  • SparseImage Parser – Efficient caching layer for reading large firmware images without loading everything into memory
  • ESP32 Firmware Parser – Extracts and analyzes bootloader, partition table, NVS (Non-Volatile Storage) data
  • Bootloader Analysis – Parses magic numbers, chip info, flash configuration, app descriptions, and SHA256 validation
  • Partition Table Detector – Auto-detects partition offset and parses partition metadata
  • SHA1/SHA256 Computation – Validates firmware integrity across regions
  • Chip Support – Recognizes ESP32, ESP32-S2, ESP32-S3, ESP32-C3, ESP32-C6 with chip-specific stubs

Device Communication

  • SLIP Protocol Layer – Handles serial framing for ESP32 bootloader communication
  • ESP32 Flasher – ROM bootloader command implementation (flash begin/end, memory operations, erase, read)
  • Stub Loader – Downloads optimized flash stub to device for faster operations
  • Serial Port Access – Direct USB/UART connection management via Web Serial API
  • Command Handlers – Sync, hard reset, baudrate change, SPI configuration

Editors & Modifications

  • NVS Editor – View, add, edit, delete non-volatile storage entries with type support (string, uint, blob)
  • Partition Editor – Replace/modify individual partition contents
  • Firmware Patcher – Apply byte-level changes to firmware images
  • Memory Writer – Write modified firmware to device via USB-JTAG or UART
  • Hex Editor – Low-level firmware viewing with configurable offset, length, and byte-width

Performance & Optimization

  • Sparse Buffer Caching – Lazy-loads only needed regions from slow devices
  • Write Buffer Merging – Combines adjacent writes into 4KB blocks for efficient device flashing
  • Speed Monitoring – Tracks read/write performance and warns of slow connections
  • Memory Map Visualization – Shows cached, modified, and unread regions in real-time

The main view shows bootloader infos, partitions and allows even editing NVS content
Data is fetched from the device as it is needed. No need to “download”, “edit”, “upload”. Just press “Write to Device” when you are done.
As much information about the application as you probably ever need.
It also has an experimental FAT reader, where you can download the files.

Leave a Reply