如何使用Rundll32执行DLL函数?
使用 ShellExecute 文档作为参考:
我从命令行运行以下命令:
C:\>RUNDLL32.EXE SHELL32.DLL,ShellExecute handle,"open","C:\Documents and Settings\admin\Desktop\tmp",NULL,NULL,SW_SHOWNORMAL
这会导致异常错误。
我不知道这意味着什么:
HINSTANCE ShellExecute(
__in_opt HWND hwnd,
__in_opt LPCTSTR lpOperation,
__in LPCTSTR lpFile,
__in_opt LPCTSTR lpParameters,
__in_opt LPCTSTR lpDirectory,
__in INT nShowCmd
);
但是在描述中,提到了句柄(HWND)和指向空终止字符串的指针(LPCTSTR),但这非常令人困惑。
任何帮助将不胜感激。我还想了解更多,所以任何参考资料(书籍、网络链接等)也很棒!
Using the ShellExecute documentation as a reference:
I run the following from the command line:
C:\>RUNDLL32.EXE SHELL32.DLL,ShellExecute handle,"open","C:\Documents and Settings\admin\Desktop\tmp",NULL,NULL,SW_SHOWNORMAL
This results in an exception error.
I don't know what this means:
HINSTANCE ShellExecute(
__in_opt HWND hwnd,
__in_opt LPCTSTR lpOperation,
__in LPCTSTR lpFile,
__in_opt LPCTSTR lpParameters,
__in_opt LPCTSTR lpDirectory,
__in INT nShowCmd
);
But in the description, a handle (HWND), and a pointer to a null-terminated string (LPCTSTR), are mentioned, but it is very confusing.
Any help would be greatly appreciated. I would also like to learn more, so any references (book, web links, etc) would also be great!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Rundll32 仅支持运行具有以下签名的 DLL 导出:
它不支持运行任意入口点。由于 ShellExecute 没有该签名,因此显然会发生不好的事情。
信息:Windows Rundll 和 Rundll32 接口 有关 rundll32 接口的更多信息。
如果你想从命令行执行 ShellExecute 的等效操作,只需使用 start:
Rundll32 only supports running DLL exports with the following signature:
It does not support running arbitrary entry points. Since ShellExecute does not have that signature, clearly bad things will happen.
INFO: Windows Rundll and Rundll32 Interface has more info on the rundll32 interface.
If you want to do the equivelent of ShellExecute from the command line, just use start: