The ms-sys
utility can not only identify many variants of MBR and PBR boot codes, but also write them if needed.
Usage:
ms-sys [options] [device]
Options:
-1, --fat12 Write a FAT12 floppy boot record to device
-2, --fat32nt5 Write a FAT32 partition NT5.0 boot record to device
-8, --fat32nt6 Write a FAT32 partition NT6.0 boot record to device
-x, --exfatnt6 Write a EXFAT partition NT6.0 boot record to device
-e, --fat32pe Write a FAT32 partition PE boot record to device
-3, --fat32 Write a FAT32 partition DOS boot record to device
-4, --fat32free Write a FAT32 partition FreeDOS boot record to device
-5, --fat16free Write a FAT16 partition FreeDOS boot record to device
-6, --fat16 Write a FAT16 partition DOS boot record to device
-n, --ntfs Write a NTFS partition Windows 7 boot record to device
-o, --fat16ros Write a FAT16 partition ReactOS boot record to device
-c, --fat32ros Write a FAT32 partition ReactOS boot record to device
-q, --fat32kos Write a FAT32 partition KolibriOS boot record to device
-l, --wipelabel Reset partition disk label in boot record
-p, --partition Write partition info (hidden sectors, heads and drive id)
to boot record
-H, --heads <n> Manually set number of heads if partition info is written
-B, --bps <n> Manually set number of bytes per sector (default 512)
-O, --writeoem <s> Write OEM ID string <s> to file system
-S, --writewds <x> Write Windows Disk Signature hexadecimal <x> to MBR
-7, --mbr7 Write a Windows 7 MBR to device
-i, --mbrvista Write a Windows Vista MBR to device
-m, --mbr Write a Windows 2000/XP/2003 MBR to device
-9, --mbr95b Write a Windows 95B/98/98SE/ME MBR to device
-d, --mbrdos Write a DOS/Windows NT MBR to device
-s, --mbrsyslinux Write a Syslinux MBR to device
-t, --mbrgptsyslinux Write a Syslinux GPT MBR to device
-a, --mbrreactos Write a ReactOS MBR to device
-k, --mbrkolibrios Write a KolibriOS MBR to device
-r, --mbrrufus Write a Rufus MBR to device
-g, --mbrgrub4dos Write a Grub4Dos MBR to device
-b, --mbrgrub2 Write a Grub 2 MBR to device
-z, --mbrzero Write an empty (zeroed) MBR to device
-f, --force Force writing of boot record
-h, --help Display this help and exit
-v, --version Show program version
-w, --write Write automatically selected boot record to device
Default Inspect current boot record
Warning: Writing the wrong kind of boot record to a device might
destroy partition information or file system!
Examples of use in inspection mode (typical results on a pure UEFI system):
# ms-sys /dev/sda # MBR of an UEFI-bootable disk
/dev/sda has an x86 boot sector,
it is a zeroed non-bootable master boot record, like the one this
program creates with the switch -z on a hard disk device.
# ms-sys /dev/sda1 # PBR of an UEFI ESP
/dev/sda1 has a FAT32 file system.
/dev/sda1 has an x86 boot sector,
it is an unknown boot record
The OEM ID is mkfs.fat
Invalid partition table.Error loading operating system.Missing operating system.
") I was able to do a Google search and found two sites which discussed windows bootloaders. The hexdump of mine matches parts of the Win2k bootloader as well as the bootloader of one of the posters in the forum. See: masm32.com/board/…, and thestarman.pcministry.com/asm/mbr/Win2kmbr.htm.