I want to sell my arduino based device (as far as I know it is allowed) but I'm afraid of reverse compiling. Is it enough just to upload the code or I have to convert it to a hex file? I want to make a GUI for it and I searched but I only found it communicating via c++.
So my question is that, can you get the exact code which is uploaded to the board?
Before you upload the code to an Arduino it is compiled to a binary file. The sketch itself does not get uploaded to the Arduino
It is possible to download the binary file from the Arduino but it is not a trivial task to turn it back into a sketch if that is what you are worried about. Possible but not likely. Certainly, things like variable names will not be the originals and, of course, there will be no comments
The binary data can be read out of program memory and disassembled to make a machine language version of the code. That doesn't help beginners much.
However, just about any program that an Arduino can carry out could be pretty easily duplicated from scratch by a skilled programmer, so there is not much point making great effort to protect your intellectual property.
put arduino into an enclosure and fill with epoxy resin
All people have to do is write new code, you did, didn’t you ?
It’s not rocket science after all.
To be melted away with DMSO.
I'm impressed by one of the more extreme examples of "decompiling" previous programming efforts, namely the MAME Project's efforts to reconstruct old arcade games by decapping the chips and reading out the ROM code, bit by bit, visually, from microscope images.
...like the IBM PC BIOS. To clone it, a team of programmers were given only functional specifications of the BIOS facilities. They were quarantined carefully so that they could not disassemble and examine the 8088 machine code. In very little time, they legally reproduced the entire thing. From scratch.
The ability to read the program memory can be disabled by setting the appropriate fuses.
Yes, setting the protection bits may, for some, offer peace of mind. Hardly secure, though.
I don't know if a decompiler exists for the Arduino. Most of Arduino C++ isn't standard C++ so it would have to be Arduino (or AVR) specific.
And of course the decompiler can't possibly know the original variable names and there are no comments in the machine code, and you might not get the exact same overall program structure, you'd just get something that's functionally the same. And if you used any additional libraries, the decompiled code would probably be done without libraries.
It's often hard-enough to figure-out somebody else's code that uses logical variable names and is well documented/commented...
It's a zero sum game. The idea is to make the cost of cracking it greater than the cost of developing it.
If all someone wants to do is build copies of your product, they do not need to decompile the code. The code read from one arduino can be directly written to another.
As a practical matter, if you have a product that is successful enough to make it worth the effort, someone will make a similar or identical product, regardless of whether they try to decompile your original code, or just write the code from scratch themselves.
You can set 'fuses' when you program the ATmega328p that will prevent anyone without special resources from seeing your code. You will not be able to change the sketch without using high-voltage serial programming to reset the chip to factory settings.
Yes, then there is a double barrier, cracking the IC, and also deciphering the code.
If you have a fantastic idea, you have about a year to get investors to buy you out before the device is duplicated - even patents may not give you much more time as you must pay the legal bill to defend the patent.
Any computer code can be recreated by good programmer(s). The copycats often improve on the original: better, faster, better interface.
Your question comes up very often. If you ask, you likely do not have the expertise to move up the technology ladder to fully protect the code.
Get it working. Get some interest. Find a buyer. Move on to next great idea.
Ray
As mentioned above, it can be very difficult or impossible to prevent people from reverse engineering or otherwise duplicating your product, most especially if you have limited resources for legal protection and enforcement of your rights. So instead of wasting a bunch of effort on that, you might consider a different paradigm.
Make your code and hardware design open source. Design the product so that it can be easily programmed with custom firmware. Welcome contributions from the community to your code and designs.
This can add significant value to your product. You may find that you will get customers who are specifically interested in the product due to the ability to tinker and customize. You may find that customers will give preference to your product over the copycats because you are the "good guy". Publishing innovations in this manner can convey an impression of "ownership" in the eyes of the community that keeping it a trade secret or patenting never would.
And if you study the licenses of any code or hardware designs you are using, you might discover that you are legally obligated to do this sharing in any case.
It's the fair thing to do. People donated thousands of hours of their time for free to make some of the tools you're using. Pay it back to the community that enabled you to do it in the first place.
I reverse engineered various data communication protocols from various manufacturers in the 1980's. I used a recording communication monitor and designed and programmed a communication front-end processor for Data General mini-computers. NEVER had access to the original code in any device.
IF the OP will make up some type of string that has the appearance of machine code and can embed it in his program, then that will effectively stop someone from spending their time trying to determine what the program does, based on the machine code.
Paul
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.