Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
LinkBack Thread Tools Display Modes
Old 10th May 2004, 12:57 AM   (permalink)
Default Can they reverse-engineer the PIC code

Hi:

I have this question which, I hope is just hypothetical one.
Can someone read the hex code off the already programmed PIC, then use some software to translate the hex code to Basic, C or assembly?
If so what can I do to prevent it?
I just hate to waste weeks on project, then someone else gets it for free in few mouse clicks.

Thanks to all respondents.
joe_1 is offline  
Old 10th May 2004, 04:55 AM   (permalink)
Default

You can set the code protect in the configuration bits, that way its basically impossible for anyone to read the code off the chip. If you don't it's fairly simple to get the assembly code, and its possible but much more difficult to get the basic or c code.
mattg2k4 is offline  
Old 10th May 2004, 04:58 AM   (permalink)
Default

It's very likely. I do this all the time when I inspect my AVR devices. I'd check the Microchip.com appnotes for information on your model's programming locks and fuses options. Which PIC version are you working with?
DigiTan is offline  
Old 10th May 2004, 06:59 AM   (permalink)
Default Re: Can they reverse-engineer the PIC code

Quote:
Originally Posted by joe_1
I have this question which, I hope is just hypothetical one.
Can someone read the hex code off the already programmed PIC, then use some software to translate the hex code to Basic, C or assembly?
If so what can I do to prevent it?
It's very simple to disassemble the code back to assembler, but you can't convert it back to BASIC or C. My programmer software includes a disassembler to do this, and MPLAB can do it as well - PIC assembler all having single length instructions makes it very simple.

If you don't want this to be possible, simply code protect the PIC - then no one can read it, at least without massive time and money being spent!.

You can either code protect in your source code (in the config settings), or you can set code protection ON in your assembler.

One warning though, NEVER!! code protect a UV eraseable PIC, if you do it can't ever be erased again, and you've wasted an expensive device.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline  
Old 13th May 2004, 03:19 PM   (permalink)
Default

:cry:

Ok here is the sad truth, pics are not secure, I know, I have "dabbled" in this area for purely "education" reasons (not to rip people off!), I have also had my own code ripped off, it's not nice.....

Basic rule of thumb, flash parts are less secure than "C" parts, BUT always use the newest version of a "C" part that you can, the dies are smaller, less have been "busted" so the price is higher for anyone to get the code.

There is a neat and reliable way to increase the code protection "factor" of a flash part, BUT it WILL cost you lost chips in production, and an I/O line..........

1:Charge a 100uF(ish) cap to approx 13-30V (you have to kill a few chips to find the exact voltage)
2: Dump this voltage into RB7 of the "victim"
3: Test this I/O line to make SURE that this is now between 0-30(ish)Ohm's resistance, this is VERY important if it is open circuit then all you have achieved is to destroy the connecting wire from the pin to the die, this can be replaced resonably easily......
4: Don't come crying to me when you loose 10% of your PIC's to this method, you must decide if your code is worth this much to you....

Don't bother grinding the leg off a pic, a bit of "silver" paint (as used to repair PCB's) will soon sort this out :cry:

Sorry to be so pesimistic, but on the bright side, unless your code has mass appeal, you will probably be OK.
To stop the casual wannabe "hacker", grinding the numbers off the top of the chip is a big help, they can't look for "16F84 busting" on the net if they don't know what it is....

In case you are wondering, Atmels are no better

OK that is all I want to say on the subject, I will not answer any "how do I get the code out of a xxxx" questions, I just want to stop anyone feeling to "cosy" with the mchip promises.

Like most "security" in life, if someone REALLY wants it.....they will get it....
__________________
Regards


MATT!
Matt(Pic progger) is offline  
Old 13th May 2004, 08:06 PM   (permalink)
Default

Quote:
Originally Posted by Matt(Pic progger)
Basic rule of thumb, flash parts are less secure than "C" parts, BUT always use the newest version of a "C" part that you can, the dies are smaller, less have been "busted" so the price is higher for anyone to get the code.
As far as I've ever heard the only problem was with the original 16C84, which was the main reason for the change to 16F84 - I've not heard of any others been cracked electronically.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline  
Reply

Bookmarks

Thread Tools
Display Modes





All times are GMT. The time now is 05:52 AM.


Electronic Circuits  |  Learning Electronics
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.

eXTReMe Tracker