[英]How to hide the dependencies' function names in shared library?
I'm buiding a shared library on Linux, which reference to other library like boost
, CryptoPP
, jsoncpp
.我在 Linux 上建立了一个共享库,它引用了其他库,如
boost
、 CryptoPP
、 jsoncpp
。 The problem is the final.so file contains function names, in IDA Pro :问题是 final.so 文件包含 function 个名称,在IDA Pro中:
I thought it's because linking to dynamic library, so I build boost
static library, but boost
function names still visible.我以为是因为链接到动态库,所以我构建了
boost
static 库,但是boost
function 名称仍然可见。
I tried strip the.so file:我尝试剥离.so 文件:
strip my.so
strip --strip-unneeded -x my.so
Still no luck.仍然没有运气。
Some competitors may reverse engineer my library, how to hide these function names to make it more difficult to crack?一些竞争对手可能会对我的库进行反向工程,如何隐藏这些 function 名称以使其更难破解?
LOCAL_LDFLAGS += -Wl,--exclude-libs,ALL, -Wl,--gc-sections
You should你应该
-fvisility=hidden
(functions which are actually exported should be marked with __attribute__((visibility("default")))
in code-fvisility=hidden
编译(实际导出的函数应使用__attribute__((visibility("default")))
标记-l:libXYZ.a
syntax in LDFLAGS
);LDFLAGS
中使用-l:libXYZ.a
语法); of course they need to be present on your system.
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.