How to remove strings from a compiled binary (.so)

前端 未结 4 1684
野性不改
野性不改 2021-02-04 06:45

How do I remove strings from / obfuscate a compiled binary? The goal is to avoid having people read the names of the functions/methods inside.

It is a dynamic library (.

4条回答
  •  太阳男子
    2021-02-04 07:11

    Assuming you are correctly specifying a hidden visibility to g++ for all of your source files (as other posters have recommended), there's a chance you might be running in to this GCC bug: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38643

    Try dumping the symbols in your binary that are showing up (readelf -Wa mylib.so | c++filt | less); if you see only vtable and VTT symbols after demangling, then the gcc bug might be your problem.

    Edit: if you can, try GCC 4.4.0 or later, as it appears to be fixed there.

提交回复
热议问题