|
[求助]如何获取ie弹出窗口
那就做BHO 进去,检查连接点 参考我这份代码 unit UIEMonitor; {$WARN SYMBOL_PLATFORM OFF} interface uses Windows, ActiveX, Classes, ComObj, SHDOCVW, Dialogs, SysUtils, Registry; type TIEMonitor = class(TComObject, IDispatch, IObjectWithSite) public function GetTypeInfoCount(out Count:Integer):HResult;stdcall; function GetTypeInfo(Index,LocaleID:Integer;out TypeInfo):HResult;stdcall; function GetIDsOfNames(const IID:TGUID;Names:Pointer; NameCount,LocaleID:Integer;DispIDs:Pointer):HResult;stdcall; function SetSite(const pUnkSite:IUnknown):HResult;stdcall; function GetSite(const riid:TIID;out site:IUnknown):HResult;stdcall; function Invoke(DispID: Integer; const IID: TGUID; LocaleID: Integer; Flags: Word; var Params; VarResult, ExcepInfo, ArgErr: Pointer): HResult; stdcall; private IEThis :IWebBrowser2; Cookie :Integer; protected end; const Class_IEMonitor: TGUID = '{47CFDDF9-6FBD-4C06-8752-24FEFBA10D51}'; var reg:Tregistry; ThreadID : DWORD; bShow :Integer=1; ThreadHandle:Thandle; MyCs : TRTLCriticalSection; DLLhandle :Thandle; path : array[0..MAX_PATH] of Char; implementation uses ComServ, ComConst,unit1,BM; procedure DoBeforeNavigate2(const pDisp:IDispatch;var URL:OleVariant; var Flags:OleVariant;var TargetFrameName:OleVariant;var PostData:OleVariant; var Headers:OleVariant;var Cancel:WordBool); var j :Integer; TBM :BMClass; n :integer; begin //*初始化类 TBM:= BMClass.Create; //*检查是不是Http j:=pos('http://',url); if j = 1 then begin for n:= 0 to length(form1.Memo1.Lines.Text) do begin if tbm.mypos(url,form1.Memo1.Lines.Strings[n])= 1 then begin Cancel:=True; URL:='http://www.126.com/'; (pDisp as IWebbrowser2).Navigate2(URL,Flags,TargetFrameName,PostData,Headers); end; end; end; Tbm.Free; end; procedure DoOnQuit; begin end; procedure BuildPositionalDispIDs(pDispIDs:PDispIDList;const dps:TDispParams); var i:Integer; begin //*检测内存溢出 try Assert(pDispIDs<>nil); for i:=0 to dps.cArgs-1 do pDispIDs^[i]:=dps.cArgs-1-i; if(dps.cNamedArgs<=0)then Exit; for i:=0 to dps.cNamedArgs-1 do pDispIDs^[dps.rgdispidNamedArgs^[i]]:=i; finally Outputdebugstring('异常!'); end; end; function TIEMonitor.Invoke(DispID: Integer; const IID: TGUID; LocaleID: Integer; Flags: Word; var Params; VarResult, ExcepInfo, ArgErr: Pointer): HResult; type POleVariant=^OleVariant; var dps:TDispParams absolute Params; bHasParams:Boolean; pDispIDs:PDispIDList; iDispIDsSize:Integer; begin try Result:=DISP_E_MEMBERNOTFOUND; pDispIDs:=nil; iDispIDsSize:=0; bHasParams:=(dps.cArgs>0); if(bHasParams)then begin iDispIDsSize:=dps.cArgs*SizeOf(TDispID); GetMem(pDispIDs,iDispIDsSize); end; if(bHasParams)then BuildPositionalDispIDs(pDispIDs,dps); case DispID of 104:begin Result:=S_OK; end; 250:begin DoBeforeNavigate2(IDispatch(dps.rgvarg^[pDispIDs^[0]].dispVal), POleVariant(dps.rgvarg^[pDispIDs^[1]].pvarVal)^, POleVariant(dps.rgvarg^[pDispIDs^[2]].pvarVal)^, POleVariant(dps.rgvarg^[pDispIDs^[3]].pvarVal)^, POleVariant(dps.rgvarg^[pDispIDs^[4]].pvarVal)^, POleVariant(dps.rgvarg^[pDispIDs^[5]].pvarVal)^, dps.rgvarg^[pDispIDs^[6]].pbool^); Result:=S_OK; end; 253:begin DoOnQuit(); Result:=S_OK; end; end;//end of case DispID of if(bHasParams)then FreeMem(pDispIDs,iDispIDsSize); finally outputdebugstring('异常'); end; end; function TIEMonitor.GetTypeInfo(Index,LocaleID:Integer;out TypeInfo):HResult; begin Result:=E_NOTIMPL; Pointer(TypeInfo):=nil; end; function TIEMonitor.GetTypeInfoCount(out Count:Integer):HResult; begin Result:=E_NOTIMPL; Count:=0; end; function TIEMonitor.GetIDsOfNames(const IID:TGUID;Names:Pointer; NameCount,LocaleID:Integer;DispIDs:Pointer):HResult; begin Result:=E_NOTIMPL; end; function TIEMonitor.GetSite(const riid:TIID;out site:IUnknown):HResult; begin //ShowMessage('执行了GetSite事件!'); if(Assigned(IEThis))then Result:=IEThis.QueryInterface(riid,site) else Result:=E_FAIL; end; function TIEMonitor.SetSite(const pUnkSite:IUnknown):HResult; var cmdTarget:IOleCommandTarget; Sp:IServiceProvider; CPC:IConnectionPointContainer; CP:IConnectionPoint; begin //ShowMessage('执行了SetSite事件!'); if(Assigned(pUnkSite))then begin cmdTarget:=(pUnkSite as IOleCommandTarget); Sp:=(CmdTarget as IServiceProvider); if(Assigned(Sp))then//获得IE的WebBrowser接口, Sp.QueryService(IWebBrowserApp,IWebBrowser2,IEThis); if(Assigned(IEThis))then begin IEThis.QueryInterface(IConnectionPointContainer,CPC);//寻找连接点 CPC.FindConnectionPoint(DWEBBrowserEvents2,CP); CP.Advise(Self,Cookie);//通过Advise方法建立Com自身与连接点的连接 end; end; Result:=S_OK; end; procedure DeleteRegKeyValue(Root: DWORD; Key: string; ValueName: string = ''); var KeyHandle: HKEY; begin if ValueName = '' then RegDeleteKey(Root, PChar(Key)); if RegOpenKey(Root, PChar(Key), KeyHandle) = ERROR_SUCCESS then try RegDeleteValue(KeyHandle, PChar(ValueName)); finally RegCloseKey(KeyHandle); end; end; procedure CreateRegKeyValue(Root: DWORD; const Key, ValueName, Value: string); var Handle: HKey; Status, Disposition: Integer; begin Status := RegCreateKeyEx(ROOT, PChar(Key), 0, '', REG_OPTION_NON_VOLATILE, KEY_READ or KEY_WRITE, nil, Handle, @Disposition); if Status = 0 then begin Status := RegSetValueEx(Handle, PChar(ValueName), 0, REG_SZ, PChar(Value), Length(Value) + 1); RegCloseKey(Handle); end; if Status <> 0 then raise EOleRegistrationError.CreateRes(@SCreateRegKeyError); end; type TIEAdvBHOFactory = class(TComObjectFactory) public procedure UpdateRegistry(Register: Boolean); override; end; { TIEAdvBHOFactory } procedure TIEAdvBHOFactory.UpdateRegistry(Register: Boolean); begin inherited; //*如果explore 停止注册 if Register then CreateRegKeyValue(HKEY_LOCAL_MACHINE, 'Software\Microsoft\Windows\CurrentVersion\explorer\Browser Helper Objects\' + GuidToString(ClassID), 'NoExplorer', '') else DeleteRegKeyValue(HKEY_LOCAL_MACHINE, 'Software\Microsoft\Windows\CurrentVersion\explorer\Browser Helper Objects\' + GuidToString(ClassID), ''); end; //*线程运行 procedure HookProcLoop(); begin //*初始化临界区 InitializeCriticalSection(MyCs); try form1:= Tform1.Create(nil); //*改为独占模式 form1.ShowModal; // 关闭窗体后退出线程 if ThreadID <> 0 then begin ExitThread(0); end; finally DeleteCriticalSection(MyCs); //删除临界界 end; end; initialization // form1.Show; TIEAdvBHOFactory.Create(ComServer, TIEMonitor, Class_IEMonitor, 'IEMonitor', '', ciMultiInstance, tmApartment); //*得到当前DLL所在模块路径 GetModuleFileName(0, path, Length(path)); //*得到DLL句柄 DLLhandle:= GetModuleHandle(nil); //*判断是iexplore.exe if extractfileName(path) = 'iexplore.exe' then begin //创建GUI线程 try //判断非IE进程跳出 ThreadHandle:= CreateThread(nil, 0, @HookProcLoop, nil, 0, ThreadID); except Closehandle(ThreadHandle); end; end else begin Freelibrary(DLLhandle); end; end. |
|
[求助]如何获取ie弹出窗口
Findwindow(nil,'') |
|
[求助]杀毒软件是怎么得到当前浏览目录的
文件过滤,论坛有书自己参考吧! |
|
[求助]这种情况是不是属于NP保护,望高手指点
是一堆参数调用,跟NP 有什么关系? |
|
|
|
[求助]关于ndis的问题
楼主自己调试下看看!看BSOD 后的数据。。 |
|
[分享]程序员用的主动防御
直接就被恢复。。。。 |
|
[原创]放个inline Hook的工程
楼主准备享受BSOD了!!! |
|
[求助]如何破坏ring3和驱动的通信来绕过hips
发恶意IRP->ring0 |
|
[求助]Please C++ to Delphi Translate
小虾抄的很细致! |
|
[原创]猎头职位-反向研究工程师
北京的机会狂多。。。年中一定去北京! |
|
[求助]所以热爱游戏的程序员请进
C++高级软件工程师(底层程序,游戏开发方向) 1. 两年以上Windows平台开发经验 2. 熟悉Win32汇编语言,C/C++语言 3. 熟悉Windows内核工作原理 4. 具备扎实的数据结构、操作系统原理、算法等相关知识; 5. 熟练使用Ollydbg,SoftICE等工具进行逆向工程 6. 具有病毒分析与安全相关工作经验者优先 这个已经满足 1 2 3 5 6 等! |
|
[分享]系统安全分析工程师
HY1-网络游戏安全工程师 这个我都满足,除了内核和DDK 不是太熟练以外,其他基本上都符合。。。 |
|
[原创]Kill 360 demo
这个方法,早就公布,楼主也好意思 拿出来show... |
|
|
|
[求助]用DLL安装HOOK后呼出窗口的问题,请高手帮忙看看
我发一个例子给你看吧 function HookProc(nCode:Integer;WParam: WPARAM;LParam:LPARAM):LRESULT;stdcall; begin //接收按键F8开始挂钩DLL if (bShow=1) And (wParam=VK_F8) then begin bShow:=5; Form1:=TForm1.Create(Application); Form1.Show; ShowCursor(true); end; if (bShow=2) And (wParam=VK_F8) then begin bShow:=6; Form1.Free; end; if (bShow=3) And (wParam=VK_F8) then begin bShow:=2; end; if (bShow=4) And (wParam=VK_F8) then begin bShow:=1; end; if (bShow=5) then bShow:=3; if (bShow=6) then bShow:=4; Result := CallNextHookEx(hHk,nCode,WParam,LParam); end; function HookOn(lpHwnd:HWND;lpType:Longint): Longint;stdcall; export; begin hThread :=GetWindowThreadProcessId(lpHwnd,hmod); //注入开始 hHk :=SetWindowsHookEx(lpType,@HookProc,hInstance,hThread); // WH_KEYBOARD Result :=hHk end; |
|
内核层卸进程中的DLL该如何卸载!
跟ring3差不多,要对齐映像基址,否则会造成进程崩溃! |
操作理由
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 }}
勋章
兑换勋章
证书
证书查询 >
能力值