Yig*_* Wu 1 c++ dll winapi visual-studio
我不希望用户通过我的DLL中的Dependence看到所有导出功能,有没有办法做到这一点?我使用C++和MS Visual Studio编译我的DLL.
使用 *.def 文件并使用 NONAME 属性来防止导出名称:请参阅Exporting Functions from a DLL by Ordinalrather Than by Name ... 这里有一个示例。
小智 5
另一个选项可能是创建一个导出的函数,它将返回你想要隐藏的函数的地址数组 - 一旦你有这些地址,你可以直接调用它们
static void** Funcs = {&foo, &foo1, &foo2, 0};
__declspec (dllexport) void* GetFuncs (void)
{
return &Funcs;
}
Run Code Online (Sandbox Code Playgroud)
在可执行文件中,您可以执行以下操作
void** Funcs = GetFuncs();
(*Funcs[0]) (1, 2, 3);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
5544 次 |
| 最近记录: |