从 DLL 及其关联的导入库中删除导出的符号 (VS8)
有没有办法对 DLL 及其 .lib 文件进行后处理,以删除我不想要的符号?
背景:
DLL 的代码使用 boost::serialization,它可以导出(很多很多)符号。显然,这是为了使链接器不会忽略未引用但在初始化时具有重要副作用的静态对象。
然而,我非常希望 DLL 的导出符号中没有任何提升的提示。
我的原因是,由于链接步骤已完成,因此可以安全地删除由库引起的符号表中的混乱。
因此,我想知道是否有一些工具可以完成此任务。
Is there any way to postprocess a DLL and its .lib file to remove symbols that I do not want within them?
Background:
The DLL's code uses boost::serialization, which dllexports (many many) symbols. Apparently this is so as to cause the linker not to omit static objects that are unreferenced but have important side effects when initialized.
However, I'd very much prefer that there be no hint of boost within the DLL's exported symbols.
I reason that since the link step has completed that it would be safe to remove the mess in the symbol table caused by the library.
Hence, I am wondering if there exists some tool to accomplish this.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不知道有什么工具可以执行此操作,但您可以构建一段 C++ 代码,它可以更改 DLL 导出的名称。在这种情况下,您可以将不需要的名称设置为空字符串(0 字符):
这更多的是某种混淆,但完全删除名称更复杂,因为它需要对导出部分进行完全一致的重写。
I don't know a tool that does this, but here is a piece of C++ code you can build that can change a DLL exported names. In this case, you can set the names you don't want to an empty string (the 0 character):
It's more some kind of obfuscation but removing names completely is more complex since it requires a full consistent rewrite of the exports section.