Go Down

Topic: Is it possible to get the Software from the Arduino onto the Computer? (Read 316 times) previous topic - next topic

kolto

I lost some of my work, but it is still loaded onto a Arduino Nano:

Is it possible to get the Software from the Arduino onto the Computer? (Normally its the other way round)

robtillaart

in theory yes, in practice no.

The code is compiled in stored in binary format on the chip.
You can get a binary image of the chip with avrdude.exe
and you can try to disassemble this
but it will never be source code again.

often it is faster to rebuild the sketch
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

kurt6string

And if the lock bits are set correctly after flashing a production program I don't believe you can even read the binary image off the chip. The lock bits are to help prevent reverse engineering if I'm not mistaken.

robtillaart

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

pegwatcher

Which brings up another question: Are there dis-assemblers and assemblers for these chips in the public domain?

I'm afraid that won't help the OP but I'm somewhat interested.
I'm not a complete idiot. Some parts are missing.

hiduino


Which brings up another question: Are there dis-assemblers and assemblers for these chips in the public domain?

I'm afraid that won't help the OP but I'm somewhat interested.


The IDE includes an avr-objdump utility that can disassemble hex code you saved off from avrdude.
Code: [Select]

avr-objdump -D --architecture=avr:5  somefile.hex

RogerRowland


Which brings up another question: Are there dis-assemblers and assemblers for these chips in the public domain?


There are hundreds  :)

Take a look at this for starters - http://www.onlinedisassembler.com/odaweb/ - you can disassemble a whole host of platforms online.

pegwatcher

I'm not a complete idiot. Some parts are missing.

Paul__B

A good disassembler allows you to interactively and progressively define regions as code, byte tables, word tables, text areas or label tables, and define labels.  You work through the code in successive approximations, and build a facsimile of the original code in assembler.  If the code was originally in a higher level language, that can still be difficult to comprehend and optimisations or lack thereof may variously make the process more or less difficult.

fungus


The IDE includes an avr-objdump utility that can disassemble hex code you saved off from avrdude.
Code: [Select]

avr-objdump -D --architecture=avr:5  somefile.hex



I use it a lot when optimizing code - it lets you see what the compiler is doing.

(Although you'd dump the .elf file, not the .hex file)
No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

Go Up
 

Quick Reply

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Note: this post will not display until it's been approved by a moderator.
Name:
Email:

shortcuts: alt+s submit/post or alt+p preview