tags:

views:

23

answers:

2

How do I build executables using GCC so that it is not possible to search for a keyword. For example, I wrote my code using a function called "PascalTriangle" and built an executable and distributed. if I grep "PascalTriangle" on the executable then I am able to atleast know that the binary was built using that function. How do I hide this information?

Apologies, if my question is not relevant. Thank you.

A: 

there are some products the obfuscate your code and change everything to "random" strings.

there are some methods of writing code to be harder to reverse engineer it.

read this article:

Code Obfuscation

Dani
+2  A: 

Function names are part of the symbols that are removed by stripping symbols out of your executable. On Unix like platforms symbol stripping can be done using strip.

E.g.:

diciu$ nm ./a.out 
0000000100000f06 s  stub helpers
0000000100001048 D _NXArgc
0000000100001050 D _NXArgv
0000000100000ec4 T _PascalTriangle
0000000100001060 D ___progname
0000000100000000 A __mh_execute_header
0000000100001058 D _environ
                 U _exit
0000000100000ecf T _main
                 U _printf
0000000100001020 s _pvars
                 U dyld_stub_binder
0000000100000e88 T start
diciu$ strip ./a.out 
diciu$ nm ./a.out 
0000000100000000 A __mh_execute_header
                 U _exit
                 U _printf
                 U dyld_stub_binder
diciu
@diciu: Thanks so much. Stripping was the term I was looking for. I've googled and found that using -s with g++ will strip symbols.
reddy