Automatically generate a DLL .DEF file in Visual Studio?

六月ゝ 毕业季﹏ 提交于 2019-12-01 02:53:55
user2577497

I have found a place to generate the .DEF file for you here: expdef - def file generator

This works amazing and has a list of options you could also generate besides the method names of the functions and symbols.

0xC0000022L

Simply put: write a script that suits your needs. I for one created a small Perl script at some to create a .def file from an existing DLL that would then be used to create an import library (.lib) from it.

The reason there is no read-to-use tool that does it for you is because none of the tools involved can guess or somehow telepathically determine which functions or variables or constants or classes you want to export and under which names.

As you may know module definition files allow you to alter how an internal name appears in the export table, allow to export by ordinal (instead of name) or by name and ordinal. Of course they also allow to export a function multiple times (e.g. an old name due to legacy support purposes and a newer one because it follows some convention now).

Also see this question. You will notice that the answer also involves a custom script. In this case the requirement is apparently only to demangle and export the names of any and all non-static functions.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!