C++ mbr读写

本文详细探讨了如何使用C++进行MBR(主引导记录)的读写操作,强调由于该操作风险较高,可能导致数据丢失,因此在实践前务必确保理解全部代码。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

因为mbr读写比较危险,数据无价,请确保看懂所有代码后再运行调试!!!


<pre name="code" class="cpp">#include<iostream>
#include<windows.h>
/*  interfAcer  */
/*欢迎访问我的csdn blog  http://blog.youkuaiyun.com/nibiru_holmes*/
/*如果没反应请以管理员运行*/
using namespace std;
#define BOOTRECORDSIZE 440

typedef struct _BOOTRECORD {


	unsigned char BootRecord[BOOTRECORDSIZE];


}BOOTRECORD,*PBOOTRECORD;

#define DPTSIZE 64

typedef struct _DPT {


	unsigned char Dpt[DPTSIZE];


}DPT,*PDPT;





typedef struct _MBR {

	BOOTRECORD BootRecord;              //引导程序
	unsigned char ulSinged[4];          //Windows 磁盘签名
	unsigned char sReserve[2];          //保留位
	DPT Dpt;                            //分区表
	unsigned char EndSign[2];           //结束标志




}MBR,*PMBR;

#define DPTNUMBER 4
typedef struct _DP {

	unsigned char BootSign;           //引导标志
	unsigned char StartHs
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值