Windows DNS 挂钩
Windows 如何解析 DNS 以及如何拦截调用以注入我自己的域? 我在应用程序中需要这个,并且运行我自己的 DNS 服务器或修改主机文件不是解决方案。
How does Windows resolve DNS and how can I intercept the calls, in order to inject my own domains?
I need this in an application, and running my own DNS server or modifying the hosts file is not a solution.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我不确定你的目的是什么,但有几种选择。
CodeProject 包含一些可能对您有所帮助的内容。它似乎做了你需要做的事情。
现在,另一个解决方案可能涉及您自己的一些工作,这可能不适合该项目。
其一,您需要弄清楚以下函数< /a> 负责在您要修改的应用程序中进行 DNS 查找。下一阶段基本上是自己实现 CodeProject 代码,使用 Microsoft Detours 并在返回的蹦床中插入您的修改代码。
我仍然不太确定为什么你需要这样做,如果你能提供有关最终目标的更多细节,你可能会得到更好的答案。
I'm not sure what your purpose is, but there are several options.
CodeProject includes something that might help you here. It seems to do what you need to do.
Now, the other solution might involve abit of work of your own that might be inappropiate for the project.
For one, you need to figure out if the following function is the one responsible for DNS lookups in the applications you want to modify. The next stage is basically implementing the CodeProject code yourself, set up a global hook using Microsoft Detours and in the returning trampoline insert your modifying code.
I'm still not quite sure why you need to do this though, if you would provide more detail on the end goal, you might get better answers.
您可能正在 dnsapi.lib/dnsap.dll 中寻找 Hooking DNSQuery() 函数调用
You may be looking for Hooking DNSQuery() function calls in dnsapi.lib/dnsap.dll