如何在Windows 7上加载API?
我的目的是能够成功加载将挂钩 Windows API 的 .dll 文件。我已经广泛研究并尝试了任何可以在运行 Windows 7 的 64 位计算机上加载 .dll 文件的方法,但没有成功。我尝试过的两种解决方案包括将 .dll 的路径加载到注册表项中:
Computer/HKEY_LOCAL_MACHINE \SOFTWARE\Microsoft\WindowsNT\CurrentVersion\Windows\AppInit_DLLs
或
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\WindowsNT\CurrentVersion\Windows\AppInit_DLLs
请不要误会我的意思,有很多在线资源解释了如何将 API 加载到注册表,但它们都不适合我。如果这个问题的答案是显而易见的,我深表歉意,我已尽了一切努力。非常感谢您的时间和帮助!
My intention is to be able to sucessfully load a .dll file that will hook the Windows API. I have researched and tried extensively, without success, any method that would load my .dll file on a 64bit machine running Windows 7. The two solutions that I have tried include loading the path of the .dll into the registry keys:
Computer/HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsNT\CurrentVersion\Windows\AppInit_DLLs
or
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\WindowsNT\CurrentVersion\Windows\AppInit_DLLs
please don't get me wrong, there are many online resources explaining how to load APIs to the registry, but none of them have worked for me. I apologize if the answer to this question is obvious, I have tried everything I could. Thanks so much for the time and help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不要使用 AppInit_DLLs 机制,因为它非常危险,可能会导致其他应用程序崩溃和加载程序锁死锁(请参阅Raymond Chen 对此主题有发言权)。如果您绝对必须使用此机制,那么您只能调用kernel32.dll 中的函数。 根本没有运行时调用。
更好的选择是考虑使用 detours 库
Don't use the
AppInit_DLLs
mechanism as it is very dangerous and can lead to crashes and loader-lock deadlocks in other applications (see what the great Raymond Chen has to say on the subject). If you absolutely, positively must use this mechanism then you can only call functions in kernel32.dll. No runtime calls at all.A better option is to look into using the detours library
有一个 Technet 文档可能会有所帮助 - Windows 7 和 Windows Server 2008 中的 AppInit DLL R2
There's a Technet document which might help - AppInit DLLs in Windows 7 and Windows Server 2008 R2