0

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?

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

1 Answer 1

2

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]
                          [--no-progress]
                          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
                        (CLK,Q,D,HD,CS).
  --no-progress, -p     Suppress progress output
1
  • 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
    Commented Jul 19, 2019 at 8:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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