Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Can they reverse-engineer the PIC code

Status
Not open for further replies.

joe_1

Member
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.
 
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.
 
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?
 
joe_1 said:
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.
 
: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....
 
Matt(Pic progger) said:
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.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top