窗口攻击大法:
现在攻击Xurte, powertool,360等都还有用。。
界面:
1.窗口失效
void CWindowAttackDlg::On_Ok() { // TODO: Add your control notification handler code here // TODO: Add extra validation here DWORD dwInputPID = GetDlgItemInt(IDC_EDT_pid); DWORD dwPID; for (int i = 10000; i < 9999999;i++) { GetWindowThreadProcessId((HWND)i, &dwPID); if ( (dwPID == dwInputPID) || (dwPID == 0)) { ::EnableWindow((HWND)i, 0); } } }
void CWindowAttackDlg::OnOk2() { // TODO: Add your control notification handler code here WINDOWPLACEMENT stPlacement = {0}; stPlacement.length = sizeof(WINDOWPLACEMENT); stPlacement.showCmd = SW_HIDE; stPlacement.ptMaxPosition.x = -12; stPlacement.ptMaxPosition.y = -12; stPlacement.ptMinPosition.x = -12; stPlacement.ptMinPosition.y = -12; stPlacement.rcNormalPosition.bottom = -12; stPlacement.rcNormalPosition.left = -12; stPlacement.rcNormalPosition.right = -12; stPlacement.rcNormalPosition.top = -12; DWORD dwHandle = GetDlgItemInt(IDC_EDT_pid2); ::SetWindowPlacement((HWND)dwHandle, &stPlacement); ::MoveWindow((HWND)dwHandle, -1, -1, 0, 0 , FALSE); ::SetWindowPos((HWND)dwHandle,HWND_BOTTOM, -21, -12, 0, 0, SWP_HIDEWINDOW); }
typedef BOOL (__stdcall *pSetLayeredWindowAttributes) ( HWND hwnd, COLORREF crKey, BYTE bAlpha,DWORD dwFlags); int ChangeNum(CString str,int length) { char revstr[16]={0}; //根据十六进制字符串的长度,这里注意数组不要越界 int num[16]={0}; int count=1; int result=0; strcpy(revstr,str); for (int i=length-1;i>=0;i--) { if ((revstr[i]>='0') && (revstr[i]<='9')) num[i]=revstr[i]-48;//字符0的ASCII值为48 else if ((revstr[i]>='a') && (revstr[i]<='f')) num[i]=revstr[i]-'a'+10; else if ((revstr[i]>='A') && (revstr[i]<='F')) num[i]=revstr[i]-'A'+10; else num[i]=0; result=result+num[i]*count; count=count*16;//十六进制(如果是八进制就在这里乘以8) } return result; } void CWindowAttackDlg::OnOk3() { // TODO: Add your control notification handler code here DWORD dwHwnd; CString strHwnd; GetDlgItemText(IDC_EDT_pid3, strHwnd); dwHwnd = ChangeNum(strHwnd, strHwnd.GetLength()); DWORD dwExStyle = ::GetWindowLong((HWND)dwHwnd, GWL_EXSTYLE); ::SetWindowLong((HWND)dwHwnd, GWL_EXSTYLE, dwExStyle | WS_EX_LAYERED); HMODULE hUser = GetModuleHandle("user32.dll"); if (hUser == NULL) { AfxMessageBox("GetModuleHandle error"); return ; } //SetLayeredWindowAttributes pSetLayeredWindowAttributes pMySetLayeredWindowAttributes; pMySetLayeredWindowAttributes = (pSetLayeredWindowAttributes)GetProcAddress(hUser, "SetLayeredWindowAttributes"); pMySetLayeredWindowAttributes((HWND)dwHwnd, 0, 0, LWA_ALPHA); FreeLibrary(hUser); }