开发者

How to make-up/redesign/change-all-functions-and-variable-names of a program

I have a program in C/C++ code, and I wonder what approaches/programs/methodologie开发者_Go百科s 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


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


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

A quick googling provides these twos examples of such:

  • http://freshmeat.net/projects/cxx-obfus
  • http://www.stunnix.com/prod/cxxo/overview.shtml

Others almost certainly exist as well.


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.


I like ad-hoc perl using regular expressions. I've blogged a couple examples of such changes:

http://peeterjoot.wordpress.com/2009/09/02/regular-expression-driven-code-alteration/

http://peeterjoot.wordpress.com/2009/08/06/dirty-perl-tricks-using-evaluations-in-a-replacement-expression/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜