1

I'm currently using gcc 4.4.6 to compile my C++ program. I noticed that function declarations are visible in the compiled code (with O2 flag) by running the code in Valgrind. That means the program can potentially be easily reverse engineered by running in a debugger.

Is there an easy way to hide them? I understand that it's not going to stop someone who's determined, I just don't want people to reverse engineer it in 5 minutes.

4

1 回答 1

4
  1. man strip - GNU Binutils

  2. gcc has an option -fvisibility=hidden, it will make to not produce symbols for anything except exported ones.

  3. Use -O3, but use caution.

于 2013-03-04T23:35:41.630 回答