Read Flash Memory
To dump the contents of the flash memory of an AVR microcontroller, you simply need to connect an ISP programmer, and execute the appropriate avrdude command. For example, to dump an ATmega328P based arduino, using an USBTiny ISP device, execute the following:
avrdude -c usbtiny -p m328p -P usb -U flash:r:"C:\download.hex":i
This downloads the memory contents in the Intel HEX file format, which is the default format used for programming the AVR µC.
Note: if the lock bits are set, this method will not work. The only way to reset the lock bits is by erasing the entire device.
Disassemble the file
To disassemble the file, execute the appropriate avr-objdump command. Continuing with the example above, to disassemble the ATmega328P based arduino file, execute the following:
avr-objdump –j .sec1 –d –m avr5 download.hex > download.txt
It will be left to the reader to determine how to read the EEPROM or fuse bytes via a similar method.