-->
Page 1 of 2

Compare (verify) source(s) to what's baked inside an ESP8266

PostPosted: Thu Oct 06, 2022 9:42 am
by ArjenV
Due to a lack of administration I'd like to know whether there is a (simple) way to compare a source code I have in the Arduino IDE against what I actually baked into an ESP8266. Got a working program running for more than a year now and I'd like to add functionality, however, I do not know anymore which software version I actually used (I have several attempts named xxxx_v1.ino, xxx_v2.ino etc. It is probably the one with the highest version number but not sure...)
So can I download code or a checknumber from an existing ESP8266 and compare that to existing software in Arduino IDE? Or is there a simple verify function I missed?


As always thanks!

Re: Compare (verify) source(s) to what's baked inside an ESP

PostPosted: Fri Oct 07, 2022 6:07 am
by rooppoorali
Debuggers like GDBStub or Visual Micro Serial Debugger may help you.

Re: Compare (verify) source(s) to what's baked inside an ESP

PostPosted: Fri Oct 07, 2022 8:04 am
by QuickFix
Once compiled, there's no way to compare source codes from different binaries.

The only easy option you (possibly) have is to:
  • Extract the firmware from the ESP
  • Set up the exact same Arduino version (and used libraries) you used back then and compile the sources you have.
  • Compare the compiled binaries to the firmware image retrieved
Although I've never done this for ESP binaries, in theory you might be able to decompile/decode it and with educated guesses point to the actual source code you have in your collection; to my knowledge decompilers for the ESP's are non-existent, but maybe I'm wrong.

Re: Compare (verify) source(s) to what's baked inside an ESP

PostPosted: Fri Oct 07, 2022 9:57 am
by AcmeUK
It will not help you now, BUT, I always put a serial.println giving the sketch name and version in my startup section.