PDA

View Full Version : how to determine what programmed is in a PIC?



droptail
- 3rd June 2011, 19:58
Is there a way to determine what program is in one of my PIC's?
I can read it using the programmer, but of coarse no program name is there, only hex code. Is the name of the program in the hex code?

Thanks

aratti
- 3rd June 2011, 22:10
No, I have overcome this limitation reserving the last 8 location of the eeprom where I write the program name.

Cheers

Al.

Demon
- 4th June 2011, 15:18
I wouldn't say no, I've seen decompilers before.

It's possible to "recreate" a program, it's just a matter of having the right software. I just don't know of one for PBP, or MPASM.

All the information is there, except for comments, I believe those are lost. Same with fancy formatting and indentation, the best you could wish for out of decompiling would be a straightforward program.

EDIT: Here's some info on decompilers:

http://www.program-transformation.org/Transform/DeCompilation

HenrikOlsson
- 4th June 2011, 16:20
If you have the source (or .hex file rather) for what you think is in the PIC you can use the Verify feature of your programmer software to compare the .hex that is in the chip with compiled and assembled version you have on disc. If they match you know what is in your PIC.

On the other hand, if you know what what you WANT to be in it just reprogram it with the correct file.

/Henrik.

Demon
- 4th June 2011, 16:27
If you have the source (or .hex file rather) for what you think is in the PIC you can use the Verify feature of your programmer software to compare the .hex that is in the chip with compiled and assembled version you have on disc. If they match you know what is in your PIC. ...

My problem is that I often clean up comments, alignment, little details that make Verify unuseable. LOL



...On the other hand, if you know what what you WANT to be in it just reprogram it with the correct file.

That won't work well if WriteProtect is on. :D

(I never use it)

HenrikOlsson
- 4th June 2011, 16:37
There's no comments or formating information available in the in the .hex file so you can edit and tweak that as much as you want. As long as you don't change the actual code the resulting .hex will look the same no matter how much formating, commenting and tidy-up'ing you've done.

droptail
- 4th June 2011, 16:55
Thanks for the replys