So I'm trying to reverse-engineer a small PCB which has an ATMEGA48-15AT1 microcontroller on it. My question is, can a program, on said microcontroller, be downloaded and read as the C# code that its programmed in (e.g. through AtmelStudio) ?
1 Answer
An AtMega is likely to be programmed in C or C++, not C#.
In most cases the vendor of a product will enable 'read-protection' on such a chip, exactly to prevent what you are trying to do. If he forgot to do so, you can read out the chip with a small hardware device called a programmer.
If you could read out the chip (download the firmware) you would get what is stored in the (flash program and eeprom data) memory. That is equivalent to the machine code, or call it assembler code, without any hints to the structure or meaning of it.
A clever programmer could re-engineer something that resembles the original source code from the machine code, but the effort will be comparable to or even larger than the original effort of writing the code.
-
\$\begingroup\$ Ahh, okay. Yeah I thought it would be silly to expect the program not to be in machine code when downloaded from the memory. Thanks for the info. \$\endgroup\$ Commented Dec 2, 2014 at 11:26