NoJC

· · 个人记录

NoJC`s Code

#include<Windows.h>
#include<string>
#include<iostream>
#include<stdlib.h>
#include<conio.h>
#include<time.h>
using namespace std;
int main(int argc, char** argv){
    if(argc>1){
        srand(time(NULL));
        long nowx=0,nowy=0;
        try{
            POINT CursorP;
            GetCursorPos(&CursorP);
            nowx=CursorP.x;
            nowy=CursorP.y;
            const POINT vanillaCursor=CursorP;
            for(;;){
                nowx++;
                SetCursorPos(nowx,nowy);
                GetCursorPos(&CursorP);
                if(CursorP.x<=nowx){
                    long x=CursorP.x;
                    SetCursorPos(x+rand()%128+30,nowy);
                    GetCursorPos(&CursorP);
                    if(CursorP.x==x){
                        nowx=x;
                        break;
                    }else nowx+=rand()%128+30;
                }
                Sleep(10);
            }
            for(;;){
                nowy++;
                SetCursorPos(nowx,nowy);
                GetCursorPos(&CursorP);
                if(CursorP.y<=nowy){
                    long y=CursorP.y;
                    SetCursorPos(nowx,y+rand()%128+30);
                    GetCursorPos(&CursorP);
                    if(CursorP.y==y){
                        nowy=y;
                        break;
                    }else nowy+=rand()%128+30;
                }
            }
            SetCursorPos(vanillaCursor.x,vanillaCursor.y);
        }catch(...){
            throw;
        }
        class pjct{
            public:
                pjct(){
                    cout<<"按Ctrl+C或Ctrl+Break强制退出。"<<endl
                        <<"但您需要Ctrl+Alt+Delete单击注销或关机或重启后才能正常使用";
                    SetConsoleTitle("Alt+Tab以选中此程序进行操作...");
                }
                ~pjct(){
                    system("explorer.exe");
                }
        }pjt;
        const long T=time(NULL)+1582;
        while(time(NULL)<T){
            Sleep(rand()%173);
            SetCursorPos(rand()%nowx,rand()%nowy);
        }
        for(unsigned short i=0;i<26;i++)
            Beep(rand(),rand()%2500);
    }else{
        cout<<"警告"<<endl
            <<"你真的要运行反jc吗?"<<endl;
        Beep(60,1000);
        Beep(1024,1000);
        Beep(512,1000);
        cout<<"[Enter]是\t\t[Backspace]否";
        for(unsigned char c='\0';c!='\r';c=getch())
            if(c=='\b')return 0;
        string temp("start \"hi\" /MIN ");
        temp+=argv[0];
        temp+=" normal";
        system(temp.c_str());
        system("taskkill -im explorer.exe -f");
    }
}