如何使用WinHex脚本自动修复NTFS文件系统DBR

        DBR(DOS BOOT RECORD,DOS引导记录),位于柱面0,磁头1,扇区1,即逻辑扇区0。DBR分为两部分:DOS引导程序和BPB(BIOS参数块)。其中DOS引导程序完成DOS系统文件(IO.SYS,MSDOS.SYS)的定位与装载,而BPB用来描述本DOS分区的磁盘信息,BPB位于DBR偏移0BH处,共13字节。 它包含逻辑格式化时使用的参数,可供DOS计算磁盘上的文件分配表,目录区和数据区的起始地址,BPB之后三个字提供物理格式化(低格)时采用的一些参数。引导程序或设备驱动程序根据这些信息将磁盘逻辑地址(DOS扇区号)转换成物理地址(绝对扇区号)。

 

Assign Mouse CurrentPos
Assign ParSize GetSize
Assign SecSize 512
Goto 0x000
Write 0xEB52904E54465320202020
Write SecSize
Write 0x00
Write 0x0000
Write 0x000000
Write 0x0000
Write 0xF8
Write 0x0000
Write 0x3F00
Write 0xFF00
Write 0x00000000
Write 0x00000000
Write 0x80008000
Write 0x0000000000000000
Write 0x0000000000000000
Write 0x0000000000000000
Write 0xF6
Write 0x000000
Write 0x01
Write 0x000000a
Write 0x1C5B596481596420
Write 0x0000
{
Write 0x00
}[428]
Write 0x55AA

//Goto Mouse //移动到光标点击位置,提高搜索效率。
Goto 0x200 //从头扫描。
Find 0x100000006000000000001800000000004800000018000000 Down
IfFound
Move -56
Assign MFT CurrentPos
Move 272
Read QSVCN 8
Read JSVCN 8
Move 8
Read FileSize 8
EndIF
Goto 0x00D
Write ((FileSize/(JSVCN-QSVCN+1))/SecSize)
Goto 0x00D
Read CDX 1
Goto 0x030
Write (MFT/SecSize/CDX)
Goto (MFT+1354)
Read MFTMirr 6
Goto 0x038
Write MFTMirr
Goto 0x028
Write ((ParSize/SecSize)-1)
MessageBox "DBR修复完成!"