I need help to extract code from an ATmega32a microcontroller. I have knowledge about hardware, registers, assembly stuff but I'm not even close to expert about embedded systems. Even though I know reverse engineering is not for beginners still I want to learn at least basic concepts which I couldn't find on the web.
How can I communicate with the chip, extract code and decompile it? What are the hardware/software requirements for this? (Assuming code is not protected.)
Thanks in advance.
You can never get the c code from inside the Atmega32 chip, as the chip never knows the c code.
You can however get the machine code out of the chip using the following command from the terminal
avrdude -c <programmer name> -p m32 -U flash:r:read_firmware.hex:i
For this you will have to install avrdude into your system. Read more here You will also need an SPI programmer for atmega chips. My personal favorite for this is the pocket programmer from sparkfun
You can then go through the hex file via a text editor and try to understand the machine code using the Atmega32 datasheet.
Personally, I have never felt it was worth the effort.