|
[求助]谁有屏幕查看的 C or Asm 代码?
用asm来搞com编程,俺一点都不会 "其实ASM里面就是不会获取IHTMLDocument2指针" 我给的样本,反汇编一下估计可以了.. 俺现在忙着写远程管理,估计这个获取IE编辑框内容的代码,估计木着落 |
|
[求助]谁有屏幕查看的 C or Asm 代码?
"不要每次都截全屏发送,只发送改动过的部分,以提高效率" 这里我还不怎么懂。估计要看很多代码。郁闷 "那个获取IE编辑框里的内容怎么没下文了?很想学习那" 那个其实我也没有源码,只是一个程序,反汇编才明白一点点 主要的核心代码是下面,csdn上看到的,非常类似。随便附上个样本,你分析分析 IE跳转时不调用API的,调用的都是webbrower控件的事件.你可以获取IHTMLDocument2指针,然后枚举所有Frame: void EnumFrame( IHTMLDocument2 * pIHTMLDocument2 ) { if ( !pIHTMLDocument2 ) return; HRESULT hr; CComPtr< IHTMLFramesCollection2 > spFramesCollection2; pIHTMLDocument2->get_frames( &spFramesCollection2 ); //取得框架frame的集合 long nFrameCount=0; //取得子框架个数 hr = spFramesCollection2->get_length( &nFrameCount ); if ( FAILED ( hr ) || 0 == nFrameCount ) return; for(long i=0; i<nFrameCount; i++) { CComVariant vDispWin2; //取得子框架的自动化接口 hr = spFramesCollection2->item( &CComVariant(i), &vDispWin2 ); if ( FAILED ( hr ) ) continue; CComQIPtr< IHTMLWindow2 > spWin2 = vDispWin2.pdispVal; if( !spWin2 ) continue; //取得子框架的 IHTMLWindow2 接口 CComPtr < IHTMLDocument2 > spDoc2; spWin2->get_document( &spDoc2 ); //取得子框架的 IHTMLDocument2 接口 EnumForm( spDoc2 ); //递归枚举当前子框架 IHTMLDocument2 上的表单form } } //然后每个Frame里都枚举From,并枚举所有元素: //你只需要再判断是否为用户名输入框及密码输入框,即可,然后替换其文字 //代码后面,已经帮处理了其它所有工作,你只要pForm->submit();即可 //这样的提交可是IE真实的提交动作,并非你上面想要的"替换方法获得的提交结果" //所以这种方法可以说是完美的,唯一不足的地方就是,名字输入框等只能靠一些通用的命名文式命名的才能确定是名字输入框,例如,我将输入框命名为USERNAME或USERID或LOGINNAME,LOGINID等都可以一下就确认是名字输入框,但如果有些人比较BT,命名为RegNumber(注册号)即以注册号作为用户名登录或学号(StudentNo)等作为用户名,你就分辩率不出来了,所以这种情况下就不如"替换方法获得的提交结果"的方法来得正确. //对输入框的判断就留给你自己了,思路及代码已经很完整了,我想应该没有什么问题了. //祝成功! void EnumForm( IHTMLDocument2 * pIHTMLDocument2 ) { if( !pIHTMLDocument2 ) return; USES_CONVERSION; EnumFrame( pIHTMLDocument2 ); //递归枚举当前 IHTMLDocument2 上的子框架fram CComQIPtr< IHTMLElementCollection > spElementCollection; hr = pIHTMLDocument2->get_forms( &spElementCollection ); //取得表单集合 if ( FAILED( hr ) ) { cout << _T("获取表单的集合 IHTMLElementCollection 错误") << endl; return; } long nFormCount=0; //取得表单数目 hr = spElementCollection->get_length( &nFormCount ); if ( FAILED( hr ) ) { cout << _T("获取表单数目错误") << endl; return; } for(long i=0; i<nFormCount; i++) { IDispatch *pDisp = NULL; //取得第 i 项表单 hr = spElementCollection->item( CComVariant( i ), CComVariant(), &pDisp ); if ( FAILED( hr ) ) continue; CComQIPtr< IHTMLFormElement > spFormElement = pDisp; pDisp->Release(); long nElemCount=0; //取得表单中 域 的数目 hr = spFormElement->get_length( &nElemCount ); if ( FAILED( hr ) ) continue; for(long j=0; j<nElemCount; j++) { CComDispatchDriver spInputElement; //取得第 j 项表单域 hr = spFormElement->item( CComVariant( j ), CComVariant(), &spInputElement ); if ( FAILED( hr ) ) continue; CComVariant vName,vVal,vType; //取得表单域的 名,值,类型 hr = spInputElement.GetPropertyByName( L"name", &vName ); if( FAILED( hr ) ) continue; hr = spInputElement.GetPropertyByName( L"value", &vVal ); if( FAILED( hr ) ) continue; hr = spInputElement.GetPropertyByName( L"type", &vType ); if( FAILED( hr ) ) continue; LPCTSTR lpName = vName.bstrVal? OLE2CT( vName.bstrVal ) : _T("NULL"); //未知域名 LPCTSTR lpVal = vVal.bstrVal? OLE2CT( vVal.bstrVal ) : _T("NULL"); //空值,未输入 LPCTSTR lpType = vType.bstrVal? OLE2CT( vType.bstrVal ) : _T("NULL"); //未知类型 cout << _T("[") << lpType << _T("] "); cout << lpName << _T(" = ") << lpVal << endl; } //这里提交这个表单 pForm->submit(); } } |
|
|
|
[求助]发送文件
RtlMoveMemory |
|
|
|
[求助]如何区分每一个socket,然后只对一个IP发送命令?
我的思路就是,在ListBox里选中一个后,然后对比一下socket编号,对则发送。 想归想,实现起来,很多控件会卡住我。比如,在ListBox里选中一个后,这个ID列队(按扭)改怎么弄等问题。 |
|
[求助]如何区分每一个socket,然后只对一个IP发送命令?
我修改了一下,貌似不行耶。 我想估计私聊还要使用一些控件来获取socket编号,比如ListBox 4st0ne 兄弟能否在老罗聊天的例子上,使用ListBox来写个私聊的例子? |
|
|
|
[求助]发送文件
invoke send,hSocket,hMemory1,eax,0 中的参数eax的值,是 invoke lstrlen,hMemory1的返回值嘛,才刚改过来。 我用4楼的代码测试看看。 |
|
|
|
|
|
[已解决]求个Win汇编代码,请大家帮忙.
罗云彬不是有段代码吗? |
|
|
|
[求助]求个小技巧
这位兄弟每次都能给我惊喜,我太感谢您了 |
|
[求助]请问如何屏幕截图至内存
你能给个显示出图片的代码吗? |
操作理由
RANk
{{ user_info.golds == '' ? 0 : user_info.golds }}
雪币
{{ experience }}
课程经验
{{ score }}
学习收益
{{study_duration_fmt}}
学习时长
基本信息
荣誉称号:
{{ honorary_title }}
能力排名:
No.{{ rank_num }}
等 级:
LV{{ rank_lv-100 }}
活跃值:
在线值:
浏览人数:{{ visits }}
最近活跃:{{ last_active_time }}
注册时间:{{ user_info.create_date_jsonfmt }}
勋章
兑换勋章
证书
证书查询 >
能力值