Is it possible to extract a backup of the sketch uploaded to a NodeMCU (as I know that it is possible to backup the firmware).

If so, using which tools?

  • 1
    is your goal just to have a backup of the hexcode, or actually de-compile it back into C/C++? – Chad G Jul 18 '19 at 22:43
  • esptool is THE tool for esp8266 – Juraj Jul 19 '19 at 4:50

esptool.py is 'avrdude' for the esp8266. it can read the flash too. but you must know the addresses. tha first copy of the application always start at address 0x1000. the length of the application area depends on the size of the flash and the size of the SPIFFS.

> esptool.py read_flash -h
usage: esptool read_flash [-h] [--spi-connection SPI_CONNECTION]
                          address size filename

positional arguments:
  address               Start address
  size                  Size of region to dump
  filename              Name of binary dump

optional arguments:
  -h, --help            show this help message and exit
  --spi-connection SPI_CONNECTION, -sc SPI_CONNECTION
                        ESP32-only argument. Override default SPI Flash
                        connection. Value can be SPI, HSPI or a comma-
                        separated list of 5 I/O numbers to use for SPI flash
  --no-progress, -p     Suppress progress output
| improve this answer | |
  • i was under the impression that the same tool that i use to flash (firmware) would be the one to get this job done. tks 4 confirming and indicating which options to use and how to use them. UPVOTED, ACCEPTED. :) – tony gil Jul 19 '19 at 8:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.