请问,要拦截webbrowser的收发数据,是拦截那个dll和函数?我用的是IAT的方法
论坛搜索了一下,
有人说webbrowser HOOK不到的
有人说可以拦截wininet.dll中的wsasend函数
有人说,wininet.dll其实就是封装了ws2_32.dll中的函数,所以拦截ws2_32中的函数就行我查到自己的程序有wsock2.dll,拦截它的send函数后,却只对自己使用的send起作用,webbrowser没一点反应
如果拦截ws2_32.dll中的send,什么都没反应了我最早用inline hook的时候,是ws2_32.dll的send函数,那个时候确实可以拦截到webbrowser的内容的现在想请教下各位,是因为我的IAT没有HOOK好,比如GetProcedureAddress函数没有拦截到,
还是说,我之前的记忆错误,其实webbrowser拦截不到的或者说,因为webbrowser没有直接使用socket api,而是包装使用,所以不能用IAT这种方法来HOOK,只能通过inline来搞定??
论坛搜索了一下,
有人说webbrowser HOOK不到的
有人说可以拦截wininet.dll中的wsasend函数
有人说,wininet.dll其实就是封装了ws2_32.dll中的函数,所以拦截ws2_32中的函数就行我查到自己的程序有wsock2.dll,拦截它的send函数后,却只对自己使用的send起作用,webbrowser没一点反应
如果拦截ws2_32.dll中的send,什么都没反应了我最早用inline hook的时候,是ws2_32.dll的send函数,那个时候确实可以拦截到webbrowser的内容的现在想请教下各位,是因为我的IAT没有HOOK好,比如GetProcedureAddress函数没有拦截到,
还是说,我之前的记忆错误,其实webbrowser拦截不到的或者说,因为webbrowser没有直接使用socket api,而是包装使用,所以不能用IAT这种方法来HOOK,只能通过inline来搞定??
解决方案 »
- debug和release的问题
- 哪位大哥给个计算MD5值的函数代码?
- 菜鸟求指教,数据库连接
- 问一个大菜问题:什么是套打啊?用水晶报表可以套打吗?
- 请教RECT界面问题
- vb 调用 VC7 dll
- 请问用InstallShield安装后怎样将ISScript9.msi也打包进去(如果不打进去的话客户机没有装这个msi就要上网下载了)
- 哪里的论坛(forum)人流量最大,大家能交流得更多!--提高学习效率的革命
- VC中能不能执行写好的SQL语句
- 一个关于静态线程局部存储的问题,帮忙呀,谢谢!!!
- 网络编程 关于端口的问题?
- 关于《Programming Windows with MFC》的第一个例子
http://msdn.microsoft.com/en-us/library/aa770041(v=vs.85).aspx#Controlling_Navigation
Controlling NavigationYou may have wondered why the section on IDocHostUIHandler didn't mention IDocHostUIHandler::TranslateUrl as a method to implement when you wish to control page navigation. The reason is that this method is not the most general purpose technique with which to control navigation. Unless you are hosting MSHTML directly, this method will have no effect on navigation. Instead, you can control navigation by implementing your IDispatch::Invoke method to handle DISPID_BEFORENAVIGATE2. As an example, the following code prevents navigation to a particular URL, displaying the standard "Navigation Canceled" error page if the user attempts to do so.
case DISPID_BEFORENAVIGATE2:
{
// Is navigation to specified Url disallowed?
ATLASSERT((*pDispParams).rgvarg[5].vt = VT_BYREF | VT_BSTR);
CComBSTR url = ((*pDispParams).rgvarg)[5].pvarVal->bstrVal;
if (url == "http://www.adatum.com" || url == "http://www.adatum.com/")
{
// If so, navigate the browser frame to standard resource page
CComQIPtr<IWebBrowser2> spBrowser = ((*pDispParams).rgvarg)[6].pdispVal;
if (spBrowser != NULL)
{
static const CComBSTR newURL = L"res://ieframe.dll/navcancl.htm";
spBrowser->Navigate(newURL, NULL, NULL, NULL, NULL);
// Set Cancel parameter to TRUE to cancel the current event
*(((*pDispParams).rgvarg)[0].pboolVal) = TRUE;
}
}
break;
}http://msdn.microsoft.com/en-us/library/aa752134(v=vs.85).aspx
IWebBrowser2::Navigate2 Method
Navigates the browser to a location that might not be expressed as a URL, such as a pointer to an item identifier list (PIDL) for an entity in the Windows Shell namespace.
HRESULT Navigate2(
VARIANT *URL,
VARIANT *Flags,
VARIANT *TargetFrameName,
VARIANT *PostData,
VARIANT *Headers
);
不过好像和我描述的问题,没有特别的联系吧,我想要的是hook 它的低层发送和接受的api
||
ws2_32.dll
||
分层传输提供者(LSP)
||
基础协议(底层驱动)
您说的LSP编程确实很好,以后可以研究一下根据您写的通信过程,是不是可以确认,webbrowser控件的数据,应该还是通过ws2_32.dll来收发的
那么我碰到的问题,inline可以拦截,IAT不能拦截,应该是我的IAT拦截代码出问题了,没有全部替换掉了谢谢您的解答
结贴了