Anyone know of a (ideally free) obfuscator that can be used on sketches?
Why?
Sketches are compiled is that not obfuscation enough?
It is not like interpreted languages.
Grumpy_Mike:
Why?
Its my secret
acboother:
Its my secret
Then I am not telling either ![]()
I would think that any standard C/C++ obfuscator would work, but YMMV with the mIDE munging and all.
http://c-faq.com/resources/tools.html
acboother:
Anyone know of a (ideally free) obfuscator that can be used on sketches?
That's not really the spirit of Open Source Sofware ...
...R
The program may still be made open source, just a bit more difficult to read :o :o
Weedpharma
TYUIP NDPWQ QLLWE NDPRA RCSVM PVHYZ LXOJL KFDOE UIUQB YONTI TYVEG
Edit: Oops UIUQB ULUQB. Silly me.
Klaatu barada nikto
Robin2:
That's not really the spirit of Open Source Sofware ......R
I'm not ungenerous as you see I give away my Enhanced Serial Monitor which is a significant toolset and has taken me years to develop. However not everything I do is free issue and just because its on an Arduino based architecture does not mean I have to give it away.
This particular "thing" has algorithms in it I wish to protect. If I can do this then I will be able to provide updates for free they can upload for new features. If not then I will have to send out new 'things' which will cost everybody.
I know obfuscated code can be reverse engineered but its not to protect against professionals who could do this. Its to protect against hobbyists who have no interest in Arduino.
You could compile to a binary and distribute that. AFAIK, It's possible with the "upload" function in the IDE (which I have never tried). Of course, different for each board type.
When you have a working program I presume you could use a text editor to replace all the variable names and function names with meaningless 2-character alternatives. The compiler won't care.
I suspect it would be easy to write a Python program that could be given a list of all the "meaningful" names and a list of short names with which to replace them.
...R
and function names with meaningless 2-character alternatives.
I have found that using a single word and altering the capitalization on that word to get different variable and function names, is a good way to obscure interpreted source code. But as I said at the beginning this is compiled code.
check - http://stunnix.com/prod/cxxo/overview.shtml
The demo should give you some ideas how to obfuscate (source) code.
A way to obfuscate compiled code is to add additional math / processing that does not interfere with the performance too much. A switch statement could get branches that are never called, but the compiler cannot decide this. This would add extra code that will not run runtime. It also gives some sort of signature.
an example to get the idea
assume x = { 0,1,2,3 } // other values are never used.
switch(x)
{
case 4...100: y = sin(x)*PI/180-atan(sqrt(x)); break;
case 100...200: y = rand(x /cos(x)); digitalWrite(x, y); break;
case 201...255: while(1); break;
default: y = x + 2; break;
}
same can be done with floats.
Adding tables in PROGMEM that are only partly used, or are mixed
e.g. all the even addresses is a lookup for sin() and the odd ones are a lookup for tan().
sin(x) ==> Table[x2];
tan(x) ==> Table[x2 + 1];
And use a lot of goto's ... using bad practices is a good way to obfuscate ![]()
One could make of course an obfuscate.ino sketch that accepts a source as input and spits out a "monster".
maybe based upon - http://www.plexaure.de/cms/index.php?id=cobf -?
robtillaart:
One could make of course an obfuscate.ino sketch that accepts a source as input and spits out a "monster".maybe based upon - COBF - Plexaure -?
That looks interesting but I think it needs an external pre-processor. I'll study it further tomorrow.
aarg:
You could compile to a binary and distribute that. AFAIK, It's possible with the "upload" function in the IDE (which I have never tried). Of course, different for each board type.
That sounds a good approach - calling avrdude. (Tried Xloader but it locked up writing to my Nano)
Any pointers as to how to do this from the command line?
you can set in the IDE the verbose level of the uploading to see the command to use.
FILE menu -> preferences
C:\Program Files (x86)\Arduino/hardware/tools/avr/bin/avrdude -CC:\Program Files (x86)\Arduino/hardware/tools/avr/etc/avrdude.conf -v -v -v -v -patmega328p -carduino -PCOM31 -b115200 -D -Uflash:w:C:\Users\Rob\AppData\Local\Temp\build8363362365101301574.tmp/sketch_aug20b.cpp.hex:i
google AVRDUDE.html
or check - http://www.nongnu.org/avrdude/user-manual/avrdude_6.html#Example-Command-Line-Invocations
robtillaart:
you can set in the IDE the verbose level of the uploading to see the command to use.
FILE menu -> preferencesC:\Program Files (x86)\Arduino/hardware/tools/avr/bin/avrdude -CC:\Program Files (x86)\Arduino/hardware/tools/avr/etc/avrdude.conf -v -v -v -v -patmega328p -carduino -PCOM31 -b115200 -D -Uflash:w:C:\Users\Rob\AppData\Local\Temp\build8363362365101301574.tmp/sketch_aug20b.cpp.hex:i
google AVRDUDE.html
or check - AVRDUDE: 3 Terminal Mode Operation
Thank you. I think this is the way to go.
I'll need my thinking hat on as there is a shed load of options to choose from and many concepts that have no meaning to me at the moment.