Read unknown program loaded on an Arduino
Is there a way to pick up an arduino off the bench and read what the program is uploaded on it?
Unfortunately, it isn't that easy.
The "programs" you create for the Arduino are not loaded onto the board as they appear in your editor. Instead, they are compiled into machine code, and then that is loaded to the Arduino. So the Arduino just has the final compiled code on it.
There are decompilers and disassemblers that can make an attempt at going through a dump of the code to try and figure out what the original program was, but they are complex and they seldom work properly.
"Never trust a computer you can’t throw out a window." — Steve Wozniak
@dronebot-workshop -- A reply from someone on Arduino's site told me to include a "Title" to be sent to the serial port that can be cross referenced to a list made in a word document. This could be used to find what I did in the program and hence have some idea what's on the chip. It's worth doing for uploads that are mine anyway. I sure do appreciate your personal reply, as well as the effort you put into the videos and articles you do. I put in a subject request for "batteries". I do look forward to all of your work.
A reply from someone on Arduino's site told me to include a "Title" to be sent to the serial port that can be cross referenced to a list made in a word document.
What a great suggestion, thanks for passing it on.
I include this as part of all my sketches. I believe I got this snippet of code from something RoboPi posted quite awhile ago.
* Date: YYYYMMDD
* Notes: (as needed)
#define __FILENAME__ (strrchr(__FILE__, '\\') ? strrchr(__FILE__, '\\') + 1 : __FILE__)
// Print splash sheet to monitor
Serial.print("Source file: ");
Serial.println(__FILENAME__); // Source file name
Serial.print("Compile date: ");
Serial.print("Compile time: ");
That way, with the serial monitor connected I get a reminder as to where to look for the sketch that is loaded on that particular chip.
@codecage -- Excellent thing to do for future reference. Others also told me to immediately tag the board with a stick on tag. I like your permanent serial monitor idea better. Thanks for the help.