View Full Version : Free C++ Obfuscator?
Lizardsoft
06-11-2004, 01:01 PM
I have one C++ source file that is part of a larger project, which contains an algorithm that I'd rather not be viewable. Does anyone know of a good obfuscator tool for C++? I'd prefer one that uses macros to encrypt the source, but anything that makes it a big pain to figure out what the code does would be sufficient.
Mark Fassett
06-11-2004, 02:35 PM
Compile it into a static library
Lizardsoft
06-11-2004, 03:20 PM
I could but it makes life rather difficult. Ideally, I would just like the source to this one file (one function really) to be difficult to understand.
princec
06-12-2004, 02:01 AM
What's the point? (Seriously?)
Cas :)
Jason Colman
06-12-2004, 11:39 AM
What's the point? (Seriously?)
Totally. Do you want to open-source something, but not quite everything ? Do you want other coders to work on your code but not this file ? Obfuscating it will simply cause people to curse your name until you die. :)
Lizardsoft
06-12-2004, 12:45 PM
We already have an agreement that this part of the source is not meant to be readable (200 lines in a 15 000 line project) and is only being released for the sake of allowing the thing to compile, so being cursed is not an issue. I might just go with the .lib, but that makes compilation more complicated for the other party and isn't nearly as fun.
I am actually open sourcing something else, and I'm going out of my way to make that code as readable to others as possible. :)
princec
06-12-2004, 12:47 PM
What's so special about this 200 lines of code that means that you want to make it a tiny bit harder to understand?
Cas :)
Lizardsoft
06-12-2004, 01:05 PM
People just LOVE secrets ;) It contains an algorithm that only I'm supposed to know, and which only has to be cryptic enough so that someone with only basic knowledge in C++ cannot figure out in any reasonable length of time. I'd rather the protection not make the code any harder to use, meaning that keeping it as a C++ file is preferable to a library.
I'm just going to obfuscate it myself though, it turning out to be very fun.
Wayward
06-12-2004, 01:12 PM
Could this secret be that you're trying to hide a chunk of patented code you've robbed and you don't want anyone to know? ;)
Lizardsoft
06-12-2004, 01:15 PM
Not unless they patented the for loop! It's not the algo itself, it's the numbers used in it :P
Wayward
06-12-2004, 01:33 PM
Well, there's the Freeware C/C++ Sourcecode Obfuscator (http://home.arcor.de/bernhard.baier/cobf/)
I've never used it though. My C++ is naturally obfuscated already.
You know, there are people charging $1000's for professional obfuscators.
Originally posted by Lizardsoft
People just LOVE secrets ;) It contains an algorithm that only I'm supposed to know, and which only has to be cryptic enough so that someone with only basic knowledge in C++ cannot figure out in any reasonable length of time.[...]
Hm... most likely it isn't usefull to know the inner working exactly. I mean... the code is there and you could also just run that piece in a small brute force loop.
Let's say it's copy protection. If it's just put in a loop you can try a million keys per second until you find a working one.
There is no need to use your brain if you can solve the problem by throwing some cpu power at it.
Lizardsoft
06-12-2004, 03:26 PM
Originally posted by Wayward
Well, there's the Freeware C/C++ Sourcecode Obfuscator (http://home.arcor.de/bernhard.baier/cobf/)
I've never used it though. My C++ is naturally obfuscated already.
You know, there are people charging $1000's for professional obfuscators.
Beautiful, thank you very much :D This combined with a few modifications of my own will work just fine. It's just a precaution really, sort of like living in a nice neighbourhood but still locking the door to your car when leaving it in your driveway. Most likely nothing will happen, but it helps deter casual break-in.
princec
06-12-2004, 03:29 PM
Go on, what's it do then this algorithm? We're all itching to find out why it's so secret now!
Cas :)
I'm pretty sure that Mircosoft holds the patent for "security through obscurity".
Well, you've been warned ;)
MirekCz
06-12-2004, 10:14 PM
Well, now we all wait for him to release his source code and then make a competition - who's going to be first to find out what the obfuscated code does :-)
Jason Colman
06-13-2004, 01:24 AM
This reminds me of a job interview I had where one of the questions was: what does this do ? (C code):
a ^= b ^= a ^= b;
:)
Lizardsoft
06-13-2004, 09:53 AM
Originally posted by MirekCz
Well, now we all wait for him to release his source code and then make a competition - who's going to be first to find out what the obfuscated code does :-)
No, this is not being released publically, if that happened I would be in a lot of trouble :p
This stuff gets compiled into machine code anyway, which isn't all that difficult to decipher either. If I had reason to believe that there may be a malicious attempt to get that code figured out, I would be here asking about how to create encrypted binaries. It's just a precautionary measure, meant to make deciphering the code unappealing.