tags:

views:

81

answers:

4

Hi,

I have a program in C/C++ code, and I wonder what approaches/programs/methodologies can be used to:

  • change automatically or following some rules a) all variable and function names of the program b) redesign it completely: change indentation, order of how functions appear on the code, etc

So at the end, the program compiles again and gives exactly the same results.

Thankss

A: 

Sounds like you're looking for an obfuscator for C++ code.

A quick googling provides these twos examples of such:

Others almost certainly exist as well.

Amber
do you know of some others? thanks
user
A: 

Without good unit tests it's very hard to be sure that you get exactly the same results.

It's tempting to use simple text manipulation scripting tools (such as perl ) however thse don't understand the C++ syntax and so you get into confusions such literal strings versus variable names.

Hence seek out refactoring tools such as this

As has already been observed, if you want obfuscation then there are dedicated tools for that.

djna
thanks.and for instance?
user
Obfuscation tools referenced by Dav
djna
+2  A: 

Visual Assist X, even tho it's not free software. Also assuming, you work with MS-IDE.

nhaa123