├── CHANGELOG ├── po ├── de.po └── sv.po ├── CONTRIBUTORS ├── man ├── sv │ └── ms-sys.1 ├── ms-sys.1 ├── fr │ └── ms-sys.1 └── de │ └── ms-sys.1 ├── inc ├── label_11_char.h ├── br_fat12_0x0.h ├── br_fat16_0x0.h ├── br_fat32_0x0.h ├── br_ntfs_0x0.h ├── br_fat16ros_0x0.h ├── br_fat32ros_0x3f0.h ├── nls.h ├── oem_id.h ├── fat12.h ├── partition_info.h ├── ntfs.h ├── file.h ├── fat16.h ├── mbr_reactos.h ├── identify.h ├── br_fat32kos_0x52.h ├── mbr_grub.h ├── mbr_kolibri.h ├── br_fat16ros_0x3e.h ├── mbr_syslinux.h ├── mbr_dos_f2.h ├── mbr_gpt_syslinux.h ├── fat32.h ├── mbr_zero.h ├── br_fat12_0x3e.h ├── br_fat16_0x3e.h ├── mbr_rufus.h ├── br_fat16fd_0x3e.h ├── mbr_grub2.h ├── mbr_dos.h ├── br_fat32ros_0x1c00.h ├── mbr_vista.h ├── br_fat32nt_0x1800.h ├── br_fat32pe_0x1800.h ├── mbr_win7.h ├── mbr_2000.h ├── mbr_95b.h ├── br_fat32_0x3f0.h ├── br_fat32nt_0x3f0.h ├── br_fat32pe_0x3f0.h ├── br_fat32fd_0x3f0.h ├── br.h ├── br_fat32ros_0x52.h ├── br_fat32_0x52.h ├── br_fat32nt_0x52.h ├── br_fat32pe_0x52.h └── br_fat32fd_0x52.h ├── include-fallback └── libintl.h ├── TODO ├── FAQ ├── src ├── nls.c ├── fat12.c ├── ntfs.c ├── oem_id.c ├── partition_info.c ├── file.c ├── fat16.c ├── br.c └── fat32.c ├── README └── Makefile /CHANGELOG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/ms-sys/HEAD/CHANGELOG -------------------------------------------------------------------------------- /po/de.po: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/ms-sys/HEAD/po/de.po -------------------------------------------------------------------------------- /po/sv.po: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/ms-sys/HEAD/po/sv.po -------------------------------------------------------------------------------- /CONTRIBUTORS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/ms-sys/HEAD/CONTRIBUTORS -------------------------------------------------------------------------------- /man/sv/ms-sys.1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pbatard/ms-sys/HEAD/man/sv/ms-sys.1 -------------------------------------------------------------------------------- /inc/label_11_char.h: -------------------------------------------------------------------------------- 1 | unsigned char label_11_char[] = {'N','O',' ','N','A','M','E',' ',' ',' ',' '}; 2 | -------------------------------------------------------------------------------- /inc/br_fat12_0x0.h: -------------------------------------------------------------------------------- 1 | unsigned char br_fat12_0x0[] = { 2 | 0xeb, 0x3c, 0x90, 0x4d, 0x53, 0x57, 0x49, 0x4e, 0x34, 0x2e, 0x31 3 | }; 4 | -------------------------------------------------------------------------------- /inc/br_fat16_0x0.h: -------------------------------------------------------------------------------- 1 | unsigned char br_fat16_0x0[] = { 2 | 0xeb, 0x3c, 0x90, 0x4d, 0x53, 0x57, 0x49, 0x4e, 0x34, 0x2e, 0x31 3 | }; 4 | -------------------------------------------------------------------------------- /inc/br_fat32_0x0.h: -------------------------------------------------------------------------------- 1 | unsigned char br_fat32_0x0[] = { 2 | 0xeb, 0x58, 0x90, 0x4d, 0x53, 0x57, 0x49, 0x4e, 0x34, 0x2e, 0x31 3 | }; 4 | -------------------------------------------------------------------------------- /inc/br_ntfs_0x0.h: -------------------------------------------------------------------------------- 1 | unsigned char br_ntfs_0x0[] = { 2 | 0xEB, 0x52, 0x90, 0x4E, 0x54, 0x46, 0x53, 0x20, 0x20, 0x20, 0x20 3 | }; 4 | -------------------------------------------------------------------------------- /inc/br_fat16ros_0x0.h: -------------------------------------------------------------------------------- 1 | unsigned char br_fat16_0x0[] = { 2 | 0xeb, 0x71, 0x90, 0x46, 0x72, 0x4c, 0x64, 0x72, 0x31, 0x2e, 0x30 3 | }; 4 | -------------------------------------------------------------------------------- /inc/br_fat32ros_0x3f0.h: -------------------------------------------------------------------------------- 1 | unsigned char br_fat32ros_0x3f0[] = { 2 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 3 | 0x00, 0x00, 0x55, 0xaa 4 | }; 5 | -------------------------------------------------------------------------------- /include-fallback/libintl.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBINTL_H 2 | #define LIBINTL_H 3 | 4 | /* This file is only supposed to be used on systems which doesn't have a 5 | builtin libintl.h and which also miss gnu gettext */ 6 | 7 | #define NO_LIBINTL_OR_GETTEXT 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /TODO: -------------------------------------------------------------------------------- 1 | This might be done for future releases: 2 | 3 | 1. Add boot records for other file systems and OSes, NT FAT16? IBM PC-DOS? 4 | To do this I will need documentation and someone willing to test the new 5 | features. 6 | 7 | 2. Add more translations, contributions are welcome! 8 | -------------------------------------------------------------------------------- /inc/nls.h: -------------------------------------------------------------------------------- 1 | #ifndef NLS_H 2 | #define NLS_H 3 | 4 | #include 5 | 6 | #ifdef NO_LIBINTL_OR_GETTEXT 7 | #define _(String) (String) 8 | #else 9 | #define _(String) gettext(String) 10 | #endif 11 | #define gettext_noop(String) (String) 12 | #define N_(String) gettext_noop(String) 13 | 14 | /* Init Native language support */ 15 | void nls_init(void); 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /inc/oem_id.h: -------------------------------------------------------------------------------- 1 | #ifndef OEM_ID_H 2 | #define OEM_ID_H 3 | 4 | /* Returns zero terminated string with OEM ID or NULL at failure */ 5 | char *read_oem_id(FILE *fp); 6 | 7 | /* Writes OEM ID to file system */ 8 | int write_oem_id(FILE *fp, const char *szOemId); 9 | 10 | /* Returns 0 if it seems like a bad idea to write OEM ID */ 11 | int ok_to_write_oem_id(FILE *fp, const char *szPath, int bPrintMessages); 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /inc/fat12.h: -------------------------------------------------------------------------------- 1 | #ifndef FAT12_H 2 | #define FAT12_H 3 | 4 | /* returns TRUE if the file has a FAT12 file system, otherwise FALSE. 5 | The file position will change when this function is called! */ 6 | int is_fat_12_fs(FILE *fp); 7 | 8 | /* returns TRUE if the file has an exact match ot the FAT12 boot record this 9 | program would create, otherwise FALSE. 10 | The file position will change when this function is called! */ 11 | int entire_fat_12_br_matches(FILE *fp); 12 | 13 | /* Writes a FAT12 boot record to a file, returns TRUE on success, otherwise 14 | FALSE */ 15 | int write_fat_12_br(FILE *fp, int bKeepLabel); 16 | 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /FAQ: -------------------------------------------------------------------------------- 1 | Q1: I followed all instructions but my system doesn't boot!? 2 | 3 | A1: This is most likely because you are running ms-sys in a Linux environment 4 | with a 2.6 kernel. The problem is that kernel 2.6 might report a geometry 5 | incompatible with other operating systems. This makes gnu parted write 6 | incompatible geometry information when formatting the partition. Ms-sys 7 | has the switch -p which is supposed to fix the geometry information when 8 | the formatting program has failed writing this correctly, but also ms-sys 9 | will write the wrong information for the same reason. This is a known 10 | problem described in the README which also contains a link to a detailed 11 | description and a possible workaround for the problem. 12 | -------------------------------------------------------------------------------- /inc/partition_info.h: -------------------------------------------------------------------------------- 1 | #ifndef PARTITION_INFO_H 2 | #define PARTITION_INFO_H 3 | 4 | /* Writes the number of heads to a partition, if iHeads == -1 an attempt is made 5 | to find out the correct value, 6 | returns TRUE on success, otherwise FALSE */ 7 | int write_partition_number_of_heads(FILE *fp, int iHeads); 8 | 9 | /* Writes the start sector number to a partition (also known as 10 | "number of hidden sectors"), returns TRUE on success, otherwise FALSE */ 11 | int write_partition_start_sector_number(FILE *fp); 12 | 13 | /* Writes a physical disk drive id of 0x80 (for C:) to a partition */ 14 | int write_partition_physical_disk_drive_id_fat32(FILE *fp); 15 | #if 0 16 | /* This code is not yet used */ 17 | int write_partition_physical_disk_drive_id_fat16(FILE *fp); 18 | #endif 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /inc/ntfs.h: -------------------------------------------------------------------------------- 1 | #ifndef NTFS_H 2 | #define NTFS_H 3 | 4 | #include 5 | 6 | /* returns TRUE if the file has an NFTS file system, otherwise FALSE. 7 | The file position will change when this function is called! */ 8 | int is_ntfs_fs(FILE *fp); 9 | 10 | /* returns TRUE if the file has a NTFS boot record, otherwise FALSE. 11 | The file position will change when this function is called! */ 12 | int is_ntfs_br(FILE *fp); 13 | 14 | /* returns TRUE if the file has an exact match of the NTFS boot record 15 | this program would create, otherwise FALSE. 16 | The file position will change when this function is called! */ 17 | int entire_ntfs_br_matches(FILE *fp); 18 | 19 | /* Writes a NTFS boot record to a file, returns TRUE on success, otherwise 20 | FALSE */ 21 | int write_ntfs_br(FILE *fp); 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /inc/file.h: -------------------------------------------------------------------------------- 1 | #ifndef FILE_H 2 | #define FILE_H 3 | 4 | /* Max valid value of uiLen for contains_data */ 5 | #define MAX_DATA_LEN 10240 6 | 7 | /* Checks if a file contains a data pattern of length uiLen at position 8 | ulPositoin. The file pointer will change when calling this function! */ 9 | int contains_data(FILE *fp, unsigned long ulPosition, 10 | const void *pData, unsigned int uiLen); 11 | 12 | /* Reads data of length uiLen at position ulPositoin. 13 | The file pointer will change when calling this function! */ 14 | int read_data(FILE *fp, unsigned long ulPosition, 15 | void *pData, unsigned int uiLen); 16 | 17 | /* Writes a data pattern of length uiLen at position ulPositoin. 18 | The file pointer will change when calling this function! */ 19 | int write_data(FILE *fp, unsigned long ulPosition, 20 | const void *pData, unsigned int uiLen); 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /src/nls.c: -------------------------------------------------------------------------------- 1 | /****************************************************************** 2 | Copyright (C) 2009 Henrik Carlqvist 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation; either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 17 | ******************************************************************/ 18 | #include 19 | 20 | #include "nls.h" 21 | 22 | void nls_init(void) 23 | { 24 | #ifndef NO_LIBINTL_OR_GETTEXT 25 | setlocale (LC_ALL, ""); 26 | bindtextdomain (PACKAGE, LOCALEDIR); 27 | textdomain (PACKAGE); 28 | #endif 29 | } /* nls_init */ 30 | -------------------------------------------------------------------------------- /inc/fat16.h: -------------------------------------------------------------------------------- 1 | #ifndef FAT16_H 2 | #define FAT16_H 3 | 4 | #include 5 | 6 | /* returns TRUE if the file has a FAT16 file system, otherwise FALSE. 7 | The file position will change when this function is called! */ 8 | int is_fat_16_fs(FILE *fp); 9 | 10 | /* returns TRUE if the file has a FAT16 boot record, otherwise FALSE. 11 | The file position will change when this function is called! */ 12 | int is_fat_16_br(FILE *fp); 13 | 14 | /* returns TRUE if the file has an exact match of the FAT16 boot record this 15 | program would create, otherwise FALSE. 16 | The file position will change when this function is called! */ 17 | int entire_fat_16_br_matches(FILE *fp); 18 | 19 | /* Writes a FAT16 boot record to a file, returns TRUE on success, otherwise 20 | FALSE */ 21 | int write_fat_16_br(FILE *fp, int bKeepLabel); 22 | 23 | /* returns TRUE if the file has an exact match of the FAT16 boot record this 24 | program would create for FreeDOS, otherwise FALSE. 25 | The file position will change when this function is called! */ 26 | int entire_fat_16_fd_br_matches(FILE *fp); 27 | 28 | /* Writes a FAT16 FreeDOS boot record to a file, returns TRUE on success, 29 | otherwise FALSE */ 30 | int write_fat_16_fd_br(FILE *fp, int bKeepLabel); 31 | 32 | /* returns TRUE if the file has an exact match of the FAT16 boot record this 33 | program would create for ReactOS, otherwise FALSE. 34 | The file position will change when this function is called! */ 35 | int entire_fat_16_ros_br_matches(FILE *fp); 36 | 37 | /* Writes a FAT16 ReactOS boot record to a file, returns TRUE on success, 38 | otherwise FALSE */ 39 | int write_fat_16_ros_br(FILE *fp, int bKeepLabel); 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /inc/mbr_reactos.h: -------------------------------------------------------------------------------- 1 | /* First 267 bytes of MBR from ReactOS */ 2 | unsigned char mbr_reactos_0x0[] = { 3 | 0xfa, 0xfc, 0x31, 0xc0, 0x8e, 0xd0, 0x8e, 0xd8, 0xbd, 0x00, 0x7c, 0x8d, 4 | 0x66, 0xe0, 0xfb, 0xb8, 0xe0, 0x1f, 0x8e, 0xc0, 0x89, 0xee, 0x89, 0xef, 5 | 0xb9, 0x00, 0x01, 0xf3, 0xa5, 0xea, 0x22, 0x7c, 0xe0, 0x1f, 0x8e, 0xd8, 6 | 0x8e, 0xd0, 0x31, 0xc0, 0x8e, 0xc0, 0x8d, 0xbe, 0xbe, 0x01, 0xf6, 0x05, 7 | 0x80, 0x75, 0x6d, 0x83, 0xc7, 0x10, 0x81, 0xff, 0xfe, 0x7d, 0x72, 0xf2, 8 | 0xe8, 0xc4, 0x00, 0x6e, 0x6f, 0x20, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 9 | 0x20, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x66, 10 | 0x6f, 0x75, 0x6e, 0x64, 0x00, 0xeb, 0xfe, 0xe8, 0xa5, 0x00, 0x72, 0x65, 11 | 0x61, 0x64, 0x20, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x20, 0x77, 0x68, 0x69, 12 | 0x6c, 0x65, 0x20, 0x72, 0x65, 0x61, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x64, 13 | 0x72, 0x69, 0x76, 0x65, 0x00, 0xeb, 0xda, 0xe8, 0x81, 0x00, 0x70, 0x61, 14 | 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x73, 0x69, 0x67, 0x6e, 15 | 0x61, 0x74, 0x75, 0x72, 0x65, 0x20, 0x21, 0x3d, 0x20, 0x35, 0x35, 0x41, 16 | 0x41, 0x00, 0xeb, 0xb9, 0xe8, 0x10, 0x00, 0x72, 0xb6, 0x26, 0x81, 0x3e, 17 | 0xfe, 0x7d, 0x55, 0xaa, 0x75, 0xd1, 0xea, 0x00, 0x7c, 0x00, 0x00, 0xbb, 18 | 0xaa, 0x55, 0xb4, 0x41, 0xcd, 0x13, 0x72, 0x32, 0x81, 0xfb, 0x55, 0xaa, 19 | 0x75, 0x2c, 0xf6, 0xc1, 0x01, 0x74, 0x27, 0xeb, 0x10, 0x10, 0x00, 0x04, 20 | 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 21 | 0x00, 0x8b, 0x45, 0x08, 0xa3, 0xd1, 0x7c, 0x8b, 0x45, 0x0a, 0xa3, 0xd3, 22 | 0x7c, 0xb8, 0x00, 0x42, 0xbe, 0xc9, 0x7c, 0xcd, 0x13, 0xc3, 0xb8, 0x04, 23 | 0x02, 0xbb, 0x00, 0x7c, 0x8b, 0x4d, 0x02, 0x8a, 0x75, 0x01, 0xcd, 0x13, 24 | 0xc3, 0x31, 0xdb, 0xb4, 0x0e, 0xcd, 0x10, 0x5e, 0xac, 0x56, 0x3c, 0x00, 25 | 0x75, 0xf3, 0xc3 26 | }; 27 | -------------------------------------------------------------------------------- /inc/identify.h: -------------------------------------------------------------------------------- 1 | #ifndef IDENTIFY_H 2 | #define IDENTIFY_H 3 | 4 | #include 5 | 6 | #define NO_WRITING 0 7 | #define AUTO_BR 1 8 | #define MBR_DOS 2 9 | #define FAT12_BR 3 10 | #define FAT16_BR 4 11 | #define FAT32_BR 5 12 | #define FAT32NT_BR 6 13 | #define MBR_95B 7 14 | #define MBR_2000 8 15 | #define MBR_VISTA 9 16 | #define MBR_WIN7 10 17 | #define MBR_SYSLINUX 11 18 | #define MBR_ZERO 12 19 | #define FAT16FD_BR 13 20 | #define FAT32FD_BR 14 21 | #define FAT32PE_BR 15 22 | #define NTFS_BR 16 23 | #define MBR_GPT_SYSLINUX 17 24 | #define MBR_RUFUS 18 25 | #define MBR_REACTOS 19 26 | #define FAT16ROS_BR 20 27 | #define FAT32ROS_BR 21 28 | #define FAT32KOS_BR 22 29 | #define MBR_GRUB4DOS 23 30 | #define MBR_GRUB2 24 31 | #define MBR_KOLIBRIOS 25 32 | #define NUMBER_OF_RECORD_TYPES 26 33 | 34 | /* Returns the number of sectors on disk before partition */ 35 | unsigned long partition_start_sector(FILE *fp); 36 | /* Returns the number of heads for the drive of a partition */ 37 | unsigned short partition_number_of_heads(FILE *fp); 38 | 39 | /* Returns TRUE if writing a boot record of type iBr seems like a good idea, 40 | otherwise FALSE */ 41 | int sanity_check(FILE *fp, const char *szPath, int iBr, int bPrintMessages); 42 | 43 | /* Prints some information about a device */ 44 | void diagnose(FILE *fp, const char *szPath); 45 | 46 | /* Does a smart automatic selection of which boot record to write, returns 47 | the kind of boot record as defined above */ 48 | int smart_select(FILE *fp); 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /src/fat12.c: -------------------------------------------------------------------------------- 1 | /****************************************************************** 2 | Copyright (C) 2009 Henrik Carlqvist 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation; either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 17 | ******************************************************************/ 18 | #include 19 | #include 20 | 21 | #include "file.h" 22 | #include "fat12.h" 23 | 24 | int is_fat_12_fs(FILE *fp) 25 | { 26 | char *szMagic = "FAT12 "; 27 | 28 | return contains_data(fp, 0x36, szMagic, strlen(szMagic)); 29 | } /* is_fat_12_fs */ 30 | 31 | int entire_fat_12_br_matches(FILE *fp) 32 | { 33 | #include "br_fat12_0x0.h" 34 | #include "br_fat12_0x3e.h" 35 | 36 | return 37 | ( contains_data(fp, 0x0, br_fat12_0x0, sizeof(br_fat12_0x0)) && 38 | /* BIOS Parameter Block might differ between systems */ 39 | contains_data(fp, 0x3e, br_fat12_0x3e, sizeof(br_fat12_0x3e)) ); 40 | } /* entire_fat_12_br_matches */ 41 | 42 | int write_fat_12_br(FILE *fp, int bKeepLabel) 43 | { 44 | #include "label_11_char.h" 45 | #include "br_fat12_0x0.h" 46 | #include "br_fat12_0x3e.h" 47 | 48 | if(bKeepLabel) 49 | return 50 | ( write_data(fp, 0x0, br_fat12_0x0, sizeof(br_fat12_0x0)) && 51 | /* BIOS Parameter Block might differ between systems */ 52 | write_data(fp, 0x3e, br_fat12_0x3e, sizeof(br_fat12_0x3e)) ); 53 | else 54 | return 55 | ( write_data(fp, 0x0, br_fat12_0x0, sizeof(br_fat12_0x0)) && 56 | /* BIOS Parameter Block might differ between systems */ 57 | write_data(fp, 0x2b, label_11_char, sizeof(label_11_char)) && 58 | write_data(fp, 0x3e, br_fat12_0x3e, sizeof(br_fat12_0x3e)) ); 59 | } /* write_fat_12_br */ 60 | -------------------------------------------------------------------------------- /src/ntfs.c: -------------------------------------------------------------------------------- 1 | /****************************************************************** 2 | Copyright (C) 2012 Pete Batard 3 | Based on fat16.c Copyright (C) 2009 Henrik Carlqvist 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | ******************************************************************/ 19 | 20 | #include 21 | #include 22 | 23 | #include "file.h" 24 | #include "ntfs.h" 25 | 26 | int is_ntfs_fs(FILE *fp) 27 | { 28 | unsigned char aucMagic[] = {'N','T','F','S',' ',' ',' ',' '}; 29 | 30 | return contains_data(fp, 0x03, aucMagic, sizeof(aucMagic)); 31 | } /* is_ntfs_fs */ 32 | 33 | int is_ntfs_br(FILE *fp) 34 | { 35 | /* A "file" is probably some kind of NTFS boot record if it contains the 36 | magic chars 0x55, 0xAA at positions 0x1FE */ 37 | unsigned char aucRef[] = {0x55, 0xAA}; 38 | unsigned char aucMagic[] = {'N','T','F','S',' ',' ',' ',' '}; 39 | 40 | if( ! contains_data(fp, 0x1FE, aucRef, sizeof(aucRef))) 41 | return 0; 42 | if( ! contains_data(fp, 0x03, aucMagic, sizeof(aucMagic))) 43 | return 0; 44 | return 1; 45 | } /* is_ntfs_br */ 46 | 47 | int entire_ntfs_br_matches(FILE *fp) 48 | { 49 | #include "br_ntfs_0x0.h" 50 | #include "br_ntfs_0x54.h" 51 | 52 | return 53 | ( contains_data(fp, 0x0, br_ntfs_0x0, sizeof(br_ntfs_0x0)) && 54 | /* BIOS Parameter Block might differ between systems */ 55 | contains_data(fp, 0x54, br_ntfs_0x54, sizeof(br_ntfs_0x54)) ); 56 | } /* entire_ntfs_br_matches */ 57 | 58 | int write_ntfs_br(FILE *fp) 59 | { 60 | #include "br_ntfs_0x0.h" 61 | #include "br_ntfs_0x54.h" 62 | 63 | return 64 | ( write_data(fp, 0x0, br_ntfs_0x0, sizeof(br_ntfs_0x0)) && 65 | /* BIOS Parameter Block should not be overwritten */ 66 | write_data(fp, 0x54, br_ntfs_0x54, sizeof(br_ntfs_0x54)) ); 67 | } /* write_ntsf_br */ 68 | -------------------------------------------------------------------------------- /src/oem_id.c: -------------------------------------------------------------------------------- 1 | /****************************************************************** 2 | Copyright (C) 2015 Henrik Carlqvist 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation; either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 17 | ******************************************************************/ 18 | #include 19 | 20 | #include "file.h" 21 | #include "identify.h" 22 | #include "fat12.h" 23 | #include "fat16.h" 24 | #include "fat32.h" 25 | #include "ntfs.h" 26 | #include "nls.h" 27 | 28 | #include "oem_id.h" 29 | 30 | char *read_oem_id(FILE *fp) 31 | { 32 | static char szOemId[9]; 33 | int i; 34 | 35 | szOemId[8] = 0; 36 | if(!read_data(fp, 3, szOemId, 8)) 37 | return NULL; 38 | /* sanity check */ 39 | for(i=0; i<8; i++) 40 | if(szOemId[i] < ' ') 41 | return NULL; 42 | return szOemId; 43 | } /* read_oem_id */ 44 | 45 | int write_oem_id(FILE *fp, const char *szOemId) 46 | { 47 | static char acOemId[8]; 48 | int i; 49 | 50 | for(i=0; (i<8) && szOemId[i]; i++) 51 | acOemId[i] = szOemId[i]; 52 | while(i<8) 53 | acOemId[i++] = ' '; 54 | return write_data(fp, 3, acOemId, 8); 55 | } /* write_eom_id */ 56 | 57 | int ok_to_write_oem_id(FILE *fp, const char *szPath, int bPrintMessages) 58 | { 59 | if(sanity_check(fp, szPath, FAT12_BR, 0) || 60 | sanity_check(fp, szPath, FAT16_BR, 0) || 61 | sanity_check(fp, szPath, FAT32_BR, 0) || 62 | sanity_check(fp, szPath, NTFS_BR, 0)) 63 | return 1; 64 | if(bPrintMessages) 65 | { 66 | if(is_fat_12_fs(fp)||is_fat_16_fs(fp)||is_fat_32_fs(fp)||is_ntfs_fs(fp)) 67 | { 68 | printf( 69 | _("%s does not seem to be a floppy or disk partition device,\n"), 70 | szPath); 71 | } 72 | else 73 | { 74 | printf(_("%s does not seem to have a FAT or NTFS file system,\n"), 75 | szPath); 76 | } 77 | printf(_("use the switch -f to force writing of OEM ID\n")); 78 | } 79 | return 0; 80 | } /* ok_to_write_oem_id */ 81 | -------------------------------------------------------------------------------- /inc/br_fat32kos_0x52.h: -------------------------------------------------------------------------------- 1 | unsigned char br_fat32kos_0x52[] = { 2 | 0x46, 0x41, 0x54, 0x33, 0x32, 0x20, 0x20, 0x20, 0x80, 0x3C, 0x80, 0x75, 3 | 0x09, 0x66, 0x8B, 0x44, 0x08, 0x2E, 0x66, 0xA3, 0x1C, 0x7C, 0x66, 0x31, 4 | 0xC0, 0x8E, 0xD8, 0x8E, 0xD0, 0xBC, 0x00, 0x7C, 0x89, 0xE5, 0x88, 0x16, 5 | 0x08, 0x7A, 0xFC, 0xFB, 0x68, 0x00, 0x08, 0x07, 0x66, 0x0F, 0xB7, 0x5E, 6 | 0x0E, 0x66, 0x89, 0x1E, 0x00, 0x7A, 0x8A, 0x46, 0x10, 0x66, 0xF7, 0x66, 7 | 0x24, 0x66, 0x01, 0xD8, 0x66, 0x0F, 0xB6, 0x5E, 0x0D, 0x01, 0xDB, 0x66, 8 | 0x29, 0xD8, 0x66, 0xA3, 0x04, 0x7A, 0x66, 0x8B, 0x46, 0x2C, 0x66, 0x25, 9 | 0xFF, 0xFF, 0xFF, 0x0F, 0x31, 0xDB, 0x89, 0xDF, 0x66, 0x50, 0xE8, 0x62, 10 | 0x00, 0x0F, 0xB6, 0x4E, 0x0D, 0xC1, 0xE1, 0x04, 0x26, 0x80, 0x3D, 0x00, 11 | 0x74, 0x4D, 0x51, 0x57, 0xB9, 0x0B, 0x00, 0xBE, 0xCB, 0x7D, 0xF3, 0xA6, 12 | 0x5F, 0x59, 0x74, 0x0E, 0x83, 0xC7, 0x20, 0xE2, 0xE7, 0x66, 0x58, 0xE8, 13 | 0x8D, 0x00, 0x73, 0x33, 0x72, 0xCE, 0x66, 0x58, 0x26, 0x8B, 0x45, 0x14, 14 | 0x25, 0xFF, 0x0F, 0x66, 0xC1, 0xE0, 0x10, 0x26, 0x8B, 0x45, 0x1A, 0x31, 15 | 0xDB, 0x66, 0x50, 0xE8, 0x21, 0x00, 0x8C, 0xC0, 0x0F, 0xB6, 0x4E, 0x0D, 16 | 0xC1, 0xE1, 0x05, 0x01, 0xC8, 0x8E, 0xC0, 0x66, 0x58, 0xE8, 0x5F, 0x00, 17 | 0x72, 0xE5, 0xEA, 0x00, 0x80, 0x00, 0x00, 0xBE, 0xBA, 0x7D, 0xE8, 0x98, 18 | 0x00, 0xEB, 0xFE, 0x66, 0x0F, 0xB6, 0x4E, 0x0D, 0x66, 0xF7, 0xE1, 0x66, 19 | 0x03, 0x06, 0x04, 0x7A, 0x66, 0x03, 0x46, 0x1C, 0x06, 0x66, 0x60, 0x6A, 20 | 0x00, 0x6A, 0x00, 0x66, 0x50, 0x06, 0x53, 0x83, 0xE9, 0x7F, 0x19, 0xC0, 21 | 0x21, 0xC8, 0x83, 0xC0, 0x7F, 0x50, 0xC1, 0xE0, 0x05, 0x8C, 0xC1, 0x01, 22 | 0xC1, 0x8E, 0xC1, 0x6A, 0x10, 0xB8, 0x00, 0x42, 0x8A, 0x16, 0x08, 0x7A, 23 | 0x89, 0xE6, 0xCD, 0x13, 0xBE, 0xD9, 0x7D, 0x72, 0xB9, 0x61, 0x66, 0x61, 24 | 0x66, 0x83, 0xC0, 0x7F, 0x83, 0xE9, 0x7F, 0x77, 0xC4, 0x07, 0xC3, 0x06, 25 | 0x1E, 0x07, 0xBB, 0x00, 0x7E, 0x66, 0x50, 0x66, 0xC1, 0xE8, 0x07, 0x66, 26 | 0x3B, 0x06, 0xF9, 0x7D, 0x74, 0x0F, 0x66, 0xA3, 0xF9, 0x7D, 0x66, 0x03, 27 | 0x06, 0x00, 0x7A, 0xB9, 0x01, 0x00, 0xE8, 0x9B, 0xFF, 0x66, 0x58, 0x66, 28 | 0x83, 0xE0, 0x7F, 0x67, 0x66, 0x8B, 0x04, 0x85, 0x00, 0x7E, 0x00, 0x00, 29 | 0x66, 0x25, 0xFF, 0xFF, 0xFF, 0x0F, 0x66, 0x3D, 0xF7, 0xFF, 0xFF, 0x0F, 30 | 0xBE, 0xEB, 0x7D, 0x0F, 0x84, 0x67, 0xFF, 0x07, 0xC3, 0xAC, 0x84, 0xC0, 31 | 0x74, 0x09, 0xB4, 0x0E, 0xBB, 0x07, 0x00, 0xCD, 0x10, 0xEB, 0xF2, 0xC3, 32 | 0x43, 0x61, 0x6E, 0x6E, 0x6F, 0x74, 0x20, 0x66, 0x69, 0x6E, 0x64, 0x20, 33 | 0x66, 0x69, 0x6C, 0x65, 0x20, 0x4D, 0x54, 0x4C, 0x44, 0x5F, 0x46, 0x33, 34 | 0x32, 0x20, 0x20, 0x20, 0x0D, 0x0A, 0x00, 0x44, 0x69, 0x73, 0x6B, 0x20, 35 | 0x72, 0x65, 0x61, 0x64, 0x20, 0x65, 0x72, 0x72, 0x6F, 0x72, 0x0D, 0x0A, 36 | 0x00, 0x42, 0x61, 0x64, 0x20, 0x63, 0x6C, 0x75, 0x73, 0x74, 0x65, 0x72, 37 | 0x0D, 0x0A, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x55, 0xAA 38 | }; 39 | -------------------------------------------------------------------------------- /inc/mbr_grub.h: -------------------------------------------------------------------------------- 1 | /* 2 | * First 423 bytes of MBR from Grub4DOS (Converted from res/grub4dos/grldr.mbr) 3 | */ 4 | unsigned char mbr_grub_0x0[] = { 5 | 0xEB, 0x5E, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 6 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 7 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 8 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 9 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 10 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 11 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 12 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x20, 0x39, 0xFF, 0xFF, 13 | 0x31, 0xDB, 0x8E, 0xD3, 0xBC, 0x80, 0x05, 0xE8, 0x00, 0x00, 0x5B, 0x81, 14 | 0xEB, 0x6A, 0x00, 0xC1, 0xEB, 0x04, 0x8C, 0xC8, 0x01, 0xC3, 0x53, 0x68, 15 | 0x7B, 0x00, 0xCB, 0x68, 0x00, 0x20, 0x17, 0xBC, 0x00, 0x90, 0x80, 0xFA, 16 | 0x00, 0x74, 0x02, 0xB2, 0x80, 0x16, 0x07, 0xB0, 0x10, 0x30, 0xF6, 0x31, 17 | 0xDB, 0xE8, 0xC2, 0x00, 0x72, 0x29, 0x0E, 0x1F, 0x31, 0xF6, 0x31, 0xFF, 18 | 0xB9, 0xDF, 0x00, 0xFC, 0xF3, 0xA5, 0xBB, 0xFC, 0x1F, 0x66, 0xB8, 0x47, 19 | 0x52, 0x55, 0xAA, 0x66, 0x39, 0x07, 0x75, 0x03, 0xE8, 0x98, 0x19, 0xEA, 20 | 0xB8, 0x00, 0x00, 0x20, 0x16, 0x1F, 0x66, 0x39, 0x07, 0x74, 0x1F, 0x80, 21 | 0xF2, 0x80, 0x68, 0xC0, 0x07, 0x07, 0xB0, 0x10, 0x30, 0xF6, 0x31, 0xDB, 22 | 0xE8, 0x87, 0x00, 0x72, 0x05, 0xEA, 0x00, 0x00, 0xC0, 0x07, 0xBE, 0x92, 23 | 0x01, 0xE8, 0xAF, 0x00, 0xEB, 0xFE, 0xBE, 0xBE, 0x01, 0xE8, 0x04, 0x10, 24 | 0xF6, 0x06, 0xA4, 0x01, 0x80, 0x0F, 0x84, 0x6C, 0x19, 0x83, 0xC6, 0x0C, 25 | 0x81, 0xFE, 0xFE, 0x01, 0x72, 0xEB, 0x77, 0x2D, 0xF6, 0x06, 0xA7, 0x01, 26 | 0x01, 0x0F, 0x85, 0x1E, 0x17, 0x80, 0x0E, 0xA7, 0x01, 0x01, 0xF6, 0x06, 27 | 0xA7, 0x01, 0x02, 0x75, 0xD4, 0x68, 0x00, 0x0D, 0x07, 0xB0, 0x04, 0x31, 28 | 0xD2, 0x31, 0xDB, 0xE8, 0x3C, 0x00, 0x73, 0xC2, 0xBE, 0xAD, 0x1C, 0xE8, 29 | 0x69, 0x00, 0xE9, 0xFA, 0x16, 0xF6, 0x06, 0xA7, 0x01, 0x01, 0x0F, 0x85, 30 | 0xF1, 0x16, 0x80, 0x0E, 0xA7, 0x01, 0x01, 0xE9, 0xD2, 0x16, 0x1E, 0x06, 31 | 0x52, 0x56, 0x57, 0x55, 0xF9, 0xCD, 0x13, 0x5D, 0x5F, 0x5E, 0x5A, 0x07, 32 | 0x1F, 0xC3, 0xFA, 0xB8, 0x00, 0x20, 0x8E, 0xD0, 0xBC, 0xDC, 0x8F, 0xFB, 33 | 0x66, 0x61, 0x07, 0x1F, 0xEB, 0x97, 0xB4, 0x02, 0xBF, 0x03, 0x00, 0xB9, 34 | 0x01, 0x00, 0x60, 0x50, 0x53, 0x51, 0xFE, 0xC8, 0x00, 0xC1, 0xD0, 0xE0, 35 | 0x00, 0xC7, 0xB0, 0x01, 0xE8, 0xC7, 0xFF, 0x59, 0x5B, 0x58, 0x72, 0x04, 36 | 0xFE, 0xC8, 0x75, 0xE7, 0x61, 0x73, 0x0B, 0x60, 0x31, 0xC0, 0xE8, 0xB5, 37 | 0xFF, 0x61, 0x4F, 0x75, 0xD9, 0xF9, 0xC3, 0xB4, 0x0E, 0xCD, 0x10, 0x2E, 38 | 0xAC, 0x3C, 0x00, 0x75, 0xF6, 0xC3, 0x0D, 0x0A, 0x4D, 0x69, 0x73, 0x73, 39 | 0x69, 0x6E, 0x67, 0x20, 0x68, 0x65, 0x6C, 0x70, 0x65, 0x72, 0x2E, 0x00, 40 | 0x00, 0x3F, 0xFF 41 | }; 42 | -------------------------------------------------------------------------------- /inc/mbr_kolibri.h: -------------------------------------------------------------------------------- 1 | /* First 440 bytes of MBR from KolibriOS */ 2 | unsigned char mbr_kolibri_0x0[] = { 3 | 0x33, 0xC0, 0x8E, 0xD0, 0xBC, 0x00, 0x7C, 0xFB, 0x50, 0x07, 0x50, 0x1F, 4 | 0xFC, 0xBE, 0x1B, 0x7C, 0xBF, 0x1B, 0x06, 0x50, 0x57, 0xB9, 0xE5, 0x01, 5 | 0xF3, 0xA4, 0xCB, 0xBD, 0xBE, 0x07, 0xB1, 0x04, 0x38, 0x6E, 0x00, 0x7C, 6 | 0x09, 0x75, 0x13, 0x83, 0xC5, 0x10, 0xE2, 0xF4, 0xCD, 0x18, 0x8B, 0xF5, 7 | 0x83, 0xC6, 0x10, 0x49, 0x74, 0x19, 0x38, 0x2C, 0x74, 0xF6, 0xA0, 0xB5, 8 | 0x07, 0xB4, 0x07, 0x8B, 0xF0, 0xAC, 0x3C, 0x00, 0x74, 0xFC, 0xBB, 0x07, 9 | 0x00, 0xB4, 0x0E, 0xCD, 0x10, 0xEB, 0xF2, 0x88, 0x4E, 0x10, 0xE8, 0x46, 10 | 0x00, 0x73, 0x2A, 0xFE, 0x46, 0x10, 0x80, 0x7E, 0x04, 0x0B, 0x74, 0x0B, 11 | 0x80, 0x7E, 0x04, 0x0C, 0x74, 0x05, 0xA0, 0xB6, 0x07, 0x75, 0xD2, 0x80, 12 | 0x46, 0x02, 0x06, 0x83, 0x46, 0x08, 0x06, 0x83, 0x56, 0x0A, 0x00, 0xE8, 13 | 0x21, 0x00, 0x73, 0x05, 0xA0, 0xB6, 0x07, 0xEB, 0xBC, 0x81, 0x3E, 0xFE, 14 | 0x7D, 0x55, 0xAA, 0x74, 0x0B, 0x80, 0x7E, 0x10, 0x00, 0x74, 0xC8, 0xA0, 15 | 0xB7, 0x07, 0xEB, 0xA9, 0x8B, 0xFC, 0x1E, 0x57, 0x8B, 0xF5, 0xCB, 0xBF, 16 | 0x05, 0x00, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 17 | 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 18 | 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 19 | 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 20 | 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 21 | 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 22 | 0x90, 0x90, 0x90, 0x90, 0x90, 0x60, 0xBB, 0xAA, 0x55, 0xB4, 0x41, 0xCD, 23 | 0x13, 0x72, 0x36, 0x81, 0xFB, 0x55, 0xAA, 0x75, 0x30, 0xF6, 0xC1, 0x01, 24 | 0x74, 0x2B, 0x61, 0x60, 0x6A, 0x00, 0x6A, 0x00, 0xFF, 0x76, 0x0A, 0xFF, 25 | 0x76, 0x08, 0x6A, 0x00, 0x68, 0x00, 0x7C, 0x6A, 0x01, 0x6A, 0x10, 0xB4, 26 | 0x42, 0x8B, 0xF4, 0xCD, 0x13, 0x61, 0x61, 0x73, 0x0E, 0x4F, 0x74, 0x0B, 27 | 0x32, 0xE4, 0x52, 0xCD, 0x13, 0x5A, 0x90, 0xEB, 0xD6, 0x61, 0xF9, 0xC3, 28 | 0x49, 0x6E, 0x76, 0x61, 0x6C, 0x69, 0x64, 0x20, 0x70, 0x61, 0x72, 0x74, 29 | 0x69, 0x74, 0x69, 0x6F, 0x6E, 0x20, 0x74, 0x61, 0x62, 0x6C, 0x65, 0x00, 30 | 0x45, 0x72, 0x72, 0x6F, 0x72, 0x20, 0x6C, 0x6F, 0x61, 0x64, 0x69, 0x6E, 31 | 0x67, 0x20, 0x6F, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6E, 0x67, 0x20, 32 | 0x73, 0x79, 0x73, 0x74, 0x65, 0x6D, 0x00, 0x4D, 0x69, 0x73, 0x73, 0x69, 33 | 0x6E, 0x67, 0x20, 0x6F, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6E, 0x67, 34 | 0x20, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6D, 0x00, 0x00, 0x00, 0x00, 0x00, 35 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 36 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 37 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 38 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 39 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x2C, 0x44, 0x63 40 | }; 41 | -------------------------------------------------------------------------------- /src/partition_info.c: -------------------------------------------------------------------------------- 1 | /****************************************************************** 2 | Copyright (C) 2009 Henrik Carlqvist 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation; either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 17 | ******************************************************************/ 18 | #include 19 | 20 | #include "file.h" 21 | #include "identify.h" 22 | #include "partition_info.h" 23 | 24 | int write_partition_number_of_heads(FILE *fp, int iHeads) 25 | { 26 | unsigned char aucBuf[2]; 27 | unsigned short s = (iHeads < 0) ? partition_number_of_heads(fp) : (unsigned short)iHeads; 28 | 29 | if(!s) 30 | return 0; 31 | /* Converting a number like this is not necessary as long as we are on 32 | i386 compatible CPUs, however, the following code might make the program 33 | more portable... */ 34 | aucBuf[0] = (unsigned char)(s & 0xff); 35 | aucBuf[1] = (unsigned char)((s & 0xff00) >> 8); 36 | return write_data(fp, 0x1a, aucBuf, 2); 37 | } /* write_partition_number_of_heads */ 38 | 39 | int write_partition_start_sector_number(FILE *fp) 40 | { 41 | unsigned char aucBuf[4]; 42 | unsigned long l = partition_start_sector(fp); 43 | 44 | if(!l) 45 | return 0; 46 | /* Converting a number like this is not necessary as long as we are on 47 | i386 compatible CPUs, however, the following code might make the program 48 | more portable... */ 49 | aucBuf[0] = (unsigned char)(l & 0xff); 50 | aucBuf[1] = (unsigned char)((l & 0xff00) >> 8); 51 | aucBuf[2] = (unsigned char)((l & 0xff0000) >> 16); 52 | aucBuf[3] = (unsigned char)((l & 0xff000000) >> 24); 53 | return write_data(fp, 0x1c, aucBuf, 4); 54 | } /* write_partition_start_sector_number */ 55 | 56 | int write_partition_physical_disk_drive_id_fat32(FILE *fp) 57 | { 58 | unsigned char ucId = 0x80; /* C: */ 59 | 60 | return write_data(fp, 0x40, &ucId, 1); 61 | } /* write_partition_physical_disk_drive_id_fat32 */ 62 | 63 | #if 0 64 | /* This code is not yet used */ 65 | int write_partition_physical_disk_drive_id_fat16(FILE *fp) 66 | { 67 | unsigned char ucId = 0x80; /* C: */ 68 | 69 | return write_data(fp, 0x24, &ucId, 1); 70 | } /* write_partition_physical_disk_drive_id_fat16 */ 71 | #endif 72 | -------------------------------------------------------------------------------- /inc/br_fat16ros_0x3e.h: -------------------------------------------------------------------------------- 1 | unsigned char br_fat16_0x3e[] = { 2 | 0x46, 0x52, 0x45, 0x45, 0x4c, 0x44, 0x52, 0x20, 0x53, 0x59, 0x53, 0x4c, 3 | 0x6f, 0x61, 0x64, 0x20, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x21, 0x0d, 4 | 0x0a, 0x00, 0x50, 0x72, 0x65, 0x73, 0x73, 0x20, 0x61, 0x6e, 0x79, 0x20, 5 | 0x6b, 0x65, 0x79, 0x20, 0x74, 0x6f, 0x20, 0x72, 0x65, 0x62, 0x6f, 0x6f, 6 | 0x74, 0x2e, 0x2e, 0x2e, 0x00, 0x31, 0xc0, 0x8e, 0xd8, 0x8e, 0xd0, 0xbc, 7 | 0xe0, 0x7b, 0x89, 0xe5, 0xa0, 0x24, 0x7c, 0x3c, 0xff, 0x74, 0x02, 0x88, 8 | 0xc2, 0x88, 0x16, 0x24, 0x7c, 0x31, 0xff, 0xb4, 0x08, 0xcd, 0x13, 0x0f, 9 | 0x82, 0xb8, 0x00, 0x66, 0x0f, 0xb6, 0xdd, 0x88, 0xcf, 0xc0, 0xef, 0x06, 10 | 0x80, 0xe1, 0x3f, 0x66, 0x0f, 0xb6, 0xc9, 0x66, 0x0f, 0xb6, 0xc6, 0x66, 11 | 0x40, 0x66, 0x43, 0x66, 0xf7, 0xe1, 0x66, 0xf7, 0xe3, 0x66, 0x89, 0x46, 12 | 0x08, 0x66, 0x0f, 0xb7, 0x86, 0x2e, 0x00, 0x66, 0x03, 0x86, 0x3c, 0x00, 13 | 0x66, 0x0f, 0xb7, 0x8e, 0x36, 0x00, 0x66, 0x60, 0xbb, 0x00, 0x80, 0x8e, 14 | 0xc3, 0x31, 0xff, 0xe8, 0xb9, 0x00, 0x66, 0x61, 0x66, 0x89, 0xc3, 0x66, 15 | 0x0f, 0xb6, 0x86, 0x30, 0x00, 0x66, 0xf7, 0xe1, 0x66, 0x01, 0xd8, 0x66, 16 | 0x89, 0x46, 0x04, 0x66, 0x0f, 0xb7, 0x9e, 0x31, 0x00, 0x66, 0x83, 0xc3, 17 | 0x0f, 0x66, 0xc1, 0xeb, 0x04, 0x66, 0x01, 0xc3, 0x66, 0x89, 0x5e, 0x00, 18 | 0xbb, 0x00, 0x10, 0x8e, 0xc3, 0x31, 0xff, 0x31, 0xc9, 0x41, 0x06, 0xe8, 19 | 0x81, 0x00, 0x07, 0xba, 0x10, 0x00, 0x31, 0xdb, 0x89, 0xdf, 0x26, 0x38, 20 | 0x2d, 0x74, 0x34, 0xbe, 0x3e, 0x7c, 0xb9, 0x0b, 0x00, 0xf3, 0xa6, 0x74, 21 | 0x08, 0x83, 0xc3, 0x20, 0x4a, 0x75, 0xe9, 0xeb, 0xd3, 0x26, 0x66, 0x0f, 22 | 0xb7, 0x47, 0x1a, 0xba, 0x80, 0x0f, 0x8e, 0xc2, 0x31, 0xff, 0xe8, 0x24, 23 | 0x00, 0x83, 0xf8, 0xf8, 0x72, 0xf8, 0x8a, 0x16, 0x24, 0x7c, 0x8a, 0x36, 24 | 0xfd, 0x7d, 0xea, 0x00, 0xf8, 0x00, 0x00, 0xbe, 0x49, 0x7c, 0xe8, 0x7b, 25 | 0x00, 0xbe, 0x58, 0x7c, 0xe8, 0x75, 0x00, 0x31, 0xc0, 0xcd, 0x16, 0xcd, 26 | 0x19, 0x66, 0x60, 0x66, 0x48, 0x66, 0x48, 0x66, 0x0f, 0xb6, 0x8e, 0x2d, 27 | 0x00, 0x66, 0xf7, 0xe1, 0x66, 0x03, 0x46, 0x00, 0xe8, 0x18, 0x00, 0x66, 28 | 0x61, 0x06, 0xbb, 0x02, 0x00, 0xf7, 0xe3, 0xc1, 0xe2, 0x0c, 0x81, 0xc2, 29 | 0x00, 0x80, 0x8e, 0xc2, 0x89, 0xc3, 0x26, 0x8b, 0x07, 0x07, 0xc3, 0x66, 30 | 0x0f, 0xb7, 0xd9, 0x83, 0xfb, 0x40, 0x76, 0x03, 0xbb, 0x40, 0x00, 0x66, 31 | 0x60, 0x66, 0x6a, 0x00, 0x66, 0x50, 0x06, 0x57, 0x53, 0x6a, 0x10, 0x89, 32 | 0xe6, 0x8a, 0x16, 0x24, 0x7c, 0xb4, 0x42, 0xcd, 0x13, 0x72, 0x9c, 0x83, 33 | 0xc4, 0x10, 0xc1, 0xe3, 0x05, 0x8c, 0xc0, 0x01, 0xd8, 0x8e, 0xc0, 0x66, 34 | 0x61, 0x66, 0x01, 0xd8, 0x29, 0xd9, 0x75, 0xc7, 0xc3, 0xb4, 0x0e, 0xbb, 35 | 0x07, 0x00, 0xcd, 0x10, 0xac, 0x08, 0xc0, 0x75, 0xf4, 0xc3, 0x00, 0x00, 36 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 37 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 38 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 39 | 0x00, 0x00, 0x00, 0x00, 0x55, 0xaa 40 | }; 41 | -------------------------------------------------------------------------------- /inc/mbr_syslinux.h: -------------------------------------------------------------------------------- 1 | /* This version is from mbr.bin from syslinux 6.02 */ 2 | unsigned char mbr_syslinux_0x0[] = { 3 | 0x33, 0xc0, 0xfa, 0x8e, 0xd8, 0x8e, 0xd0, 0xbc, 0x00, 0x7c, 0x89, 0xe6, 4 | 0x06, 0x57, 0x8e, 0xc0, 0xfb, 0xfc, 0xbf, 0x00, 0x06, 0xb9, 0x00, 0x01, 5 | 0xf3, 0xa5, 0xea, 0x1f, 0x06, 0x00, 0x00, 0x52, 0x52, 0xb4, 0x41, 0xbb, 6 | 0xaa, 0x55, 0x31, 0xc9, 0x30, 0xf6, 0xf9, 0xcd, 0x13, 0x72, 0x13, 0x81, 7 | 0xfb, 0x55, 0xaa, 0x75, 0x0d, 0xd1, 0xe9, 0x73, 0x09, 0x66, 0xc7, 0x06, 8 | 0x8d, 0x06, 0xb4, 0x42, 0xeb, 0x15, 0x5a, 0xb4, 0x08, 0xcd, 0x13, 0x83, 9 | 0xe1, 0x3f, 0x51, 0x0f, 0xb6, 0xc6, 0x40, 0xf7, 0xe1, 0x52, 0x50, 0x66, 10 | 0x31, 0xc0, 0x66, 0x99, 0xe8, 0x66, 0x00, 0xe8, 0x35, 0x01, 0x4d, 0x69, 11 | 0x73, 0x73, 0x69, 0x6e, 0x67, 0x20, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 12 | 0x69, 0x6e, 0x67, 0x20, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x0d, 13 | 0x0a, 0x66, 0x60, 0x66, 0x31, 0xd2, 0xbb, 0x00, 0x7c, 0x66, 0x52, 0x66, 14 | 0x50, 0x06, 0x53, 0x6a, 0x01, 0x6a, 0x10, 0x89, 0xe6, 0x66, 0xf7, 0x36, 15 | 0xf4, 0x7b, 0xc0, 0xe4, 0x06, 0x88, 0xe1, 0x88, 0xc5, 0x92, 0xf6, 0x36, 16 | 0xf8, 0x7b, 0x88, 0xc6, 0x08, 0xe1, 0x41, 0xb8, 0x01, 0x02, 0x8a, 0x16, 17 | 0xfa, 0x7b, 0xcd, 0x13, 0x8d, 0x64, 0x10, 0x66, 0x61, 0xc3, 0xe8, 0xc4, 18 | 0xff, 0xbe, 0xbe, 0x7d, 0xbf, 0xbe, 0x07, 0xb9, 0x20, 0x00, 0xf3, 0xa5, 19 | 0xc3, 0x66, 0x60, 0x89, 0xe5, 0xbb, 0xbe, 0x07, 0xb9, 0x04, 0x00, 0x31, 20 | 0xc0, 0x53, 0x51, 0xf6, 0x07, 0x80, 0x74, 0x03, 0x40, 0x89, 0xde, 0x83, 21 | 0xc3, 0x10, 0xe2, 0xf3, 0x48, 0x74, 0x5b, 0x79, 0x39, 0x59, 0x5b, 0x8a, 22 | 0x47, 0x04, 0x3c, 0x0f, 0x74, 0x06, 0x24, 0x7f, 0x3c, 0x05, 0x75, 0x22, 23 | 0x66, 0x8b, 0x47, 0x08, 0x66, 0x8b, 0x56, 0x14, 0x66, 0x01, 0xd0, 0x66, 24 | 0x21, 0xd2, 0x75, 0x03, 0x66, 0x89, 0xc2, 0xe8, 0xac, 0xff, 0x72, 0x03, 25 | 0xe8, 0xb6, 0xff, 0x66, 0x8b, 0x46, 0x1c, 0xe8, 0xa0, 0xff, 0x83, 0xc3, 26 | 0x10, 0xe2, 0xcc, 0x66, 0x61, 0xc3, 0xe8, 0x76, 0x00, 0x4d, 0x75, 0x6c, 27 | 0x74, 0x69, 0x70, 0x6c, 0x65, 0x20, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 28 | 0x20, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 29 | 0x0d, 0x0a, 0x66, 0x8b, 0x44, 0x08, 0x66, 0x03, 0x46, 0x1c, 0x66, 0x89, 30 | 0x44, 0x08, 0xe8, 0x30, 0xff, 0x72, 0x27, 0x66, 0x81, 0x3e, 0x00, 0x7c, 31 | 0x58, 0x46, 0x53, 0x42, 0x75, 0x09, 0x66, 0x83, 0xc0, 0x04, 0xe8, 0x1c, 32 | 0xff, 0x72, 0x13, 0x81, 0x3e, 0xfe, 0x7d, 0x55, 0xaa, 0x0f, 0x85, 0xf2, 33 | 0xfe, 0xbc, 0xfa, 0x7b, 0x5a, 0x5f, 0x07, 0xfa, 0xff, 0xe4, 0xe8, 0x1e, 34 | 0x00, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x73, 35 | 0x79, 0x73, 0x74, 0x65, 0x6d, 0x20, 0x6c, 0x6f, 0x61, 0x64, 0x20, 0x65, 36 | 0x72, 0x72, 0x6f, 0x72, 0x2e, 0x0d, 0x0a, 0x5e, 0xac, 0xb4, 0x0e, 0x8a, 37 | 0x3e, 0x62, 0x04, 0xb3, 0x07, 0xcd, 0x10, 0x3c, 0x0a, 0x75, 0xf1, 0xcd, 38 | 0x18, 0xf4, 0xeb, 0xfd, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 39 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 40 | }; 41 | -------------------------------------------------------------------------------- /inc/mbr_dos_f2.h: -------------------------------------------------------------------------------- 1 | /* First 446 bytes of MBR from Dos 3.3 onwards and Windows 95A */ 2 | unsigned char mbr_dos_f2_0x0[] = { 3 | 0xfa, 0x33, 0xc0, 0x8e, 0xd0, 0xbc, 0x00, 0x7c, 0x8b, 0xf4, 0x50, 0x07, 4 | 0x50, 0x1f, 0xfb, 0xfc, 0xbf, 0x00, 0x06, 0xb9, 0x00, 0x01, 0xf2, 0xa5, 5 | 0xea, 0x1d, 0x06, 0x00, 0x00, 0xbe, 0xbe, 0x07, 0xb3, 0x04, 0x80, 0x3c, 6 | 0x80, 0x74, 0x0e, 0x80, 0x3c, 0x00, 0x75, 0x1c, 0x83, 0xc6, 0x10, 0xfe, 7 | 0xcb, 0x75, 0xef, 0xcd, 0x18, 0x8b, 0x14, 0x8b, 0x4c, 0x02, 0x8b, 0xee, 8 | 0x83, 0xc6, 0x10, 0xfe, 0xcb, 0x74, 0x1a, 0x80, 0x3c, 0x00, 0x74, 0xf4, 9 | 0xbe, 0x8b, 0x06, 0xac, 0x3c, 0x00, 0x74, 0x0b, 0x56, 0xbb, 0x07, 0x00, 10 | 0xb4, 0x0e, 0xcd, 0x10, 0x5e, 0xeb, 0xf0, 0xeb, 0xfe, 0xbf, 0x05, 0x00, 11 | 0xbb, 0x00, 0x7c, 0xb8, 0x01, 0x02, 0x57, 0xcd, 0x13, 0x5f, 0x73, 0x0c, 12 | 0x33, 0xc0, 0xcd, 0x13, 0x4f, 0x75, 0xed, 0xbe, 0xa3, 0x06, 0xeb, 0xd3, 13 | 0xbe, 0xc2, 0x06, 0xbf, 0xfe, 0x7d, 0x81, 0x3d, 0x55, 0xaa, 0x75, 0xc7, 14 | 0x8b, 0xf5, 0xea, 0x00, 0x7c, 0x00, 0x00, 0x49, 0x6e, 0x76, 0x61, 0x6c, 15 | 0x69, 0x64, 0x20, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 16 | 0x20, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x00, 0x45, 0x72, 0x72, 0x6f, 0x72, 17 | 0x20, 0x6c, 0x6f, 0x61, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x6f, 0x70, 0x65, 18 | 0x72, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x73, 0x79, 0x73, 0x74, 0x65, 19 | 0x6d, 0x00, 0x4d, 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x20, 0x6f, 0x70, 20 | 0x65, 0x72, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x73, 0x79, 0x73, 0x74, 21 | 0x65, 0x6d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 22 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 23 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 24 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 25 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 26 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 27 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 28 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 29 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 30 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 31 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 32 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 33 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 34 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 35 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 36 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 37 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 38 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 39 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 40 | }; 41 | -------------------------------------------------------------------------------- /inc/mbr_gpt_syslinux.h: -------------------------------------------------------------------------------- 1 | /* This version is from gptmbr.bin from syslinux 6.02 */ 2 | unsigned char mbr_gpt_syslinux_0x0[] = { 3 | 0x33, 0xc0, 0xfa, 0x8e, 0xd8, 0x8e, 0xd0, 0xbc, 0x00, 0x7c, 0x89, 0xe6, 4 | 0x06, 0x57, 0x8e, 0xc0, 0xfb, 0xfc, 0xbf, 0x00, 0x06, 0xb9, 0x00, 0x01, 5 | 0xf3, 0xa5, 0xea, 0x1f, 0x06, 0x00, 0x00, 0x52, 0x89, 0xe5, 0x83, 0xec, 6 | 0x1c, 0x6a, 0x1e, 0xc7, 0x46, 0xfa, 0x00, 0x02, 0x52, 0xb4, 0x41, 0xbb, 7 | 0xaa, 0x55, 0x31, 0xc9, 0x30, 0xf6, 0xf9, 0xcd, 0x13, 0x5a, 0xb4, 0x08, 8 | 0x72, 0x17, 0x81, 0xfb, 0x55, 0xaa, 0x75, 0x11, 0xd1, 0xe9, 0x73, 0x0d, 9 | 0x66, 0xc7, 0x06, 0x59, 0x07, 0xb4, 0x42, 0xeb, 0x13, 0xb4, 0x48, 0x89, 10 | 0xe6, 0xcd, 0x13, 0x83, 0xe1, 0x3f, 0x51, 0x0f, 0xb6, 0xc6, 0x40, 0xf7, 11 | 0xe1, 0x52, 0x50, 0x66, 0x31, 0xc0, 0x66, 0x99, 0x40, 0xe8, 0xdc, 0x00, 12 | 0x8b, 0x4e, 0x56, 0x8b, 0x46, 0x5a, 0x50, 0x51, 0xf7, 0xe1, 0xf7, 0x76, 13 | 0xfa, 0x91, 0x41, 0x66, 0x8b, 0x46, 0x4e, 0x66, 0x8b, 0x56, 0x52, 0x53, 14 | 0xe8, 0xc4, 0x00, 0xe2, 0xfb, 0x31, 0xf6, 0x5f, 0x59, 0x58, 0x66, 0x8b, 15 | 0x15, 0x66, 0x0b, 0x55, 0x04, 0x66, 0x0b, 0x55, 0x08, 0x66, 0x0b, 0x55, 16 | 0x0c, 0x74, 0x0c, 0xf6, 0x45, 0x30, 0x04, 0x74, 0x06, 0x21, 0xf6, 0x75, 17 | 0x19, 0x89, 0xfe, 0x01, 0xc7, 0xe2, 0xdf, 0x21, 0xf6, 0x75, 0x2e, 0xe8, 18 | 0xe1, 0x00, 0x4d, 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x20, 0x4f, 0x53, 19 | 0x0d, 0x0a, 0xe8, 0xd2, 0x00, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 20 | 0x65, 0x20, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x20, 0x70, 0x61, 0x72, 21 | 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x0d, 0x0a, 0x91, 0xbf, 0xbe, 22 | 0x07, 0x57, 0x66, 0x31, 0xc0, 0xb0, 0x80, 0x66, 0xab, 0xb0, 0xed, 0x66, 23 | 0xab, 0x66, 0x8b, 0x44, 0x20, 0x66, 0x8b, 0x54, 0x24, 0xe8, 0x40, 0x00, 24 | 0x66, 0x8b, 0x44, 0x28, 0x66, 0x8b, 0x54, 0x2c, 0x66, 0x2b, 0x44, 0x20, 25 | 0x66, 0x1b, 0x54, 0x24, 0xe8, 0x70, 0x00, 0xe8, 0x2a, 0x00, 0x66, 0x0f, 26 | 0xb7, 0xc1, 0x66, 0xab, 0xf3, 0xa4, 0x5e, 0x66, 0x8b, 0x44, 0x34, 0x66, 27 | 0x8b, 0x54, 0x38, 0xe8, 0x22, 0x00, 0x81, 0x3e, 0xfe, 0x7d, 0x55, 0xaa, 28 | 0x75, 0x85, 0x89, 0xec, 0x5a, 0x5f, 0x07, 0x66, 0xb8, 0x21, 0x47, 0x50, 29 | 0x54, 0xfa, 0xff, 0xe4, 0x66, 0x21, 0xd2, 0x74, 0x04, 0x66, 0x83, 0xc8, 30 | 0xff, 0x66, 0xab, 0xc3, 0xbb, 0x00, 0x7c, 0x66, 0x60, 0x66, 0x52, 0x66, 31 | 0x50, 0x06, 0x53, 0x6a, 0x01, 0x6a, 0x10, 0x89, 0xe6, 0x66, 0xf7, 0x76, 32 | 0xdc, 0xc0, 0xe4, 0x06, 0x88, 0xe1, 0x88, 0xc5, 0x92, 0xf6, 0x76, 0xe0, 33 | 0x88, 0xc6, 0x08, 0xe1, 0x41, 0xb8, 0x01, 0x02, 0x8a, 0x56, 0x00, 0xcd, 34 | 0x13, 0x8d, 0x64, 0x10, 0x66, 0x61, 0x72, 0x0c, 0x02, 0x7e, 0xfb, 0x66, 35 | 0x83, 0xc0, 0x01, 0x66, 0x83, 0xd2, 0x00, 0xc3, 0xe8, 0x0c, 0x00, 0x44, 36 | 0x69, 0x73, 0x6b, 0x20, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x0d, 0x0a, 0x5e, 37 | 0xac, 0xb4, 0x0e, 0x8a, 0x3e, 0x62, 0x04, 0xb3, 0x07, 0xcd, 0x10, 0x3c, 38 | 0x0a, 0x75, 0xf1, 0xcd, 0x18, 0xf4, 0xeb, 0xfd, 0x00, 0x00, 0x00, 0x00, 39 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 40 | }; 41 | -------------------------------------------------------------------------------- /inc/fat32.h: -------------------------------------------------------------------------------- 1 | #ifndef FAT32_H 2 | #define FAT32_H 3 | 4 | #include 5 | 6 | /* returns TRUE if the file has a FAT32 file system, otherwise FALSE. 7 | The file position will change when this function is called! */ 8 | int is_fat_32_fs(FILE *fp); 9 | 10 | /* returns TRUE if the file has a FAT32 DOS boot record, otherwise FALSE. 11 | The file position will change when this function is called! */ 12 | int is_fat_32_br(FILE *fp); 13 | 14 | /* returns TRUE if the file has an exact match of the FAT32 DOS boot record 15 | this program would create, otherwise FALSE. 16 | The file position will change when this function is called! */ 17 | int entire_fat_32_br_matches(FILE *fp); 18 | 19 | /* Writes a FAT32 DOS boot record to a file, returns TRUE on success, otherwise 20 | FALSE */ 21 | int write_fat_32_br(FILE *fp, int bKeepLabel); 22 | 23 | /* returns TRUE if the file has an exact match of the FAT32 boot record this 24 | program would create for FreeDOS, otherwise FALSE. 25 | The file position will change when this function is called! */ 26 | int entire_fat_32_fd_br_matches(FILE *fp); 27 | 28 | /* Writes a FAT32 FreeDOS boot record to a file, returns TRUE on success, 29 | otherwise FALSE */ 30 | int write_fat_32_fd_br(FILE *fp, int bKeepLabel); 31 | 32 | /* returns TRUE if the file has an exact match of the FAT32 boot record this 33 | program would create for NT, otherwise FALSE. 34 | The file position will change when this function is called! */ 35 | int entire_fat_32_nt_br_matches(FILE *fp); 36 | 37 | /* Writes a FAT32 NT boot record to a file, returns TRUE on success, otherwise 38 | FALSE */ 39 | int write_fat_32_nt_br(FILE *fp, int bKeepLabel); 40 | 41 | /* returns TRUE if the file has an exact match of the FAT32 boot record this 42 | program would create for NT, otherwise FALSE. 43 | The file position will change when this function is called! */ 44 | int entire_fat_32_pe_br_matches(FILE *fp); 45 | 46 | /* Writes a FAT32 NT boot record to a file, returns TRUE on success, otherwise 47 | FALSE */ 48 | int write_fat_32_pe_br(FILE *fp, int bKeepLabel); 49 | 50 | /* returns TRUE if the file has an exact match of the FAT32 boot record this 51 | program would create for ReactOS, otherwise FALSE. 52 | The file position will change when this function is called! */ 53 | int entire_fat_32_ros_br_matches(FILE *fp); 54 | 55 | /* Writes a FAT32 ReactOS boot record to a file, returns TRUE on success, otherwise 56 | FALSE */ 57 | int write_fat_32_ros_br(FILE *fp, int bKeepLabel); 58 | 59 | /* returns TRUE if the file has an exact match of the FAT32 boot record this 60 | program would create for KolibriOS, otherwise FALSE. 61 | The file position will change when this function is called! */ 62 | int entire_fat_32_kos_br_matches(FILE *fp); 63 | 64 | /* Writes a FAT32 KolibriOS boot record to a file, returns TRUE on success, otherwise 65 | FALSE */ 66 | int write_fat_32_kos_br(FILE *fp, int bKeepLabel); 67 | 68 | #endif 69 | -------------------------------------------------------------------------------- /inc/mbr_zero.h: -------------------------------------------------------------------------------- 1 | /* First 446 bytes of a zeroed MBR*/ 2 | unsigned char mbr_zero_0x0[] = { 3 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 4 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 5 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 6 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 7 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 8 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 9 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 10 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 11 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 12 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 13 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 14 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 15 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 16 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 17 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 18 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 19 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 20 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 21 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 22 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 23 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 24 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 25 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 26 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 27 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 28 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 29 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 30 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 31 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 32 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 33 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 34 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 35 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 36 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 37 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 38 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 39 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 40 | 0x00, 0x00 41 | }; 42 | -------------------------------------------------------------------------------- /inc/br_fat12_0x3e.h: -------------------------------------------------------------------------------- 1 | unsigned char br_fat12_0x3e[] = { 2 | 0x33, 0xc9, 0x8e, 0xd1, 0xbc, 0xfc, 0x7b, 0x16, 0x07, 0xbd, 3 | 0x78, 0x00, 0xc5, 0x76, 0x00, 0x1e, 0x56, 0x16, 0x55, 0xbf, 0x22, 0x05, 4 | 0x89, 0x7e, 0x00, 0x89, 0x4e, 0x02, 0xb1, 0x0b, 0xfc, 0xf3, 0xa4, 0x06, 5 | 0x1f, 0xbd, 0x00, 0x7c, 0xc6, 0x45, 0xfe, 0x0f, 0x38, 0x4e, 0x24, 0x7d, 6 | 0x20, 0x8b, 0xc1, 0x99, 0xe8, 0x7e, 0x01, 0x83, 0xeb, 0x3a, 0x66, 0xa1, 7 | 0x1c, 0x7c, 0x66, 0x3b, 0x07, 0x8a, 0x57, 0xfc, 0x75, 0x06, 0x80, 0xca, 8 | 0x02, 0x88, 0x56, 0x02, 0x80, 0xc3, 0x10, 0x73, 0xed, 0x33, 0xc9, 0xfe, 9 | 0x06, 0xd8, 0x7d, 0x8a, 0x46, 0x10, 0x98, 0xf7, 0x66, 0x16, 0x03, 0x46, 10 | 0x1c, 0x13, 0x56, 0x1e, 0x03, 0x46, 0x0e, 0x13, 0xd1, 0x8b, 0x76, 0x11, 11 | 0x60, 0x89, 0x46, 0xfc, 0x89, 0x56, 0xfe, 0xb8, 0x20, 0x00, 0xf7, 0xe6, 12 | 0x8b, 0x5e, 0x0b, 0x03, 0xc3, 0x48, 0xf7, 0xf3, 0x01, 0x46, 0xfc, 0x11, 13 | 0x4e, 0xfe, 0x61, 0xbf, 0x00, 0x07, 0xe8, 0x28, 0x01, 0x72, 0x3e, 0x38, 14 | 0x2d, 0x74, 0x17, 0x60, 0xb1, 0x0b, 0xbe, 0xd8, 0x7d, 0xf3, 0xa6, 0x61, 15 | 0x74, 0x3d, 0x4e, 0x74, 0x09, 0x83, 0xc7, 0x20, 0x3b, 0xfb, 0x72, 0xe7, 16 | 0xeb, 0xdd, 0xfe, 0x0e, 0xd8, 0x7d, 0x7b, 0xa7, 0xbe, 0x7f, 0x7d, 0xac, 17 | 0x98, 0x03, 0xf0, 0xac, 0x98, 0x40, 0x74, 0x0c, 0x48, 0x74, 0x13, 0xb4, 18 | 0x0e, 0xbb, 0x07, 0x00, 0xcd, 0x10, 0xeb, 0xef, 0xbe, 0x82, 0x7d, 0xeb, 19 | 0xe6, 0xbe, 0x80, 0x7d, 0xeb, 0xe1, 0xcd, 0x16, 0x5e, 0x1f, 0x66, 0x8f, 20 | 0x04, 0xcd, 0x19, 0xbe, 0x81, 0x7d, 0x8b, 0x7d, 0x1a, 0x8d, 0x45, 0xfe, 21 | 0x8a, 0x4e, 0x0d, 0xf7, 0xe1, 0x03, 0x46, 0xfc, 0x13, 0x56, 0xfe, 0xb1, 22 | 0x04, 0xe8, 0xc2, 0x00, 0x72, 0xd7, 0xea, 0x00, 0x02, 0x70, 0x00, 0x52, 23 | 0x50, 0x06, 0x53, 0x6a, 0x01, 0x6a, 0x10, 0x91, 0x8b, 0x46, 0x18, 0xa2, 24 | 0x26, 0x05, 0x96, 0x92, 0x33, 0xd2, 0xf7, 0xf6, 0x91, 0xf7, 0xf6, 0x42, 25 | 0x87, 0xca, 0xf7, 0x76, 0x1a, 0x8a, 0xf2, 0x8a, 0xe8, 0xc0, 0xcc, 0x02, 26 | 0x0a, 0xcc, 0xb8, 0x01, 0x02, 0x80, 0x7e, 0x02, 0x0e, 0x75, 0x04, 0xb4, 27 | 0x42, 0x8b, 0xf4, 0x8a, 0x56, 0x24, 0xcd, 0x13, 0x61, 0x61, 0x72, 0x0a, 28 | 0x40, 0x75, 0x01, 0x42, 0x03, 0x5e, 0x0b, 0x49, 0x75, 0x77, 0xc3, 0x03, 29 | 0x18, 0x01, 0x27, 0x0d, 0x0a, 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 30 | 0x20, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x20, 0x64, 0x69, 0x73, 0x6b, 31 | 0xff, 0x0d, 0x0a, 0x44, 0x69, 0x73, 0x6b, 0x20, 0x49, 0x2f, 0x4f, 0x20, 32 | 0x65, 0x72, 0x72, 0x6f, 0x72, 0xff, 0x0d, 0x0a, 0x52, 0x65, 0x70, 0x6c, 33 | 0x61, 0x63, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x64, 0x69, 0x73, 0x6b, 34 | 0x2c, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x20, 0x70, 35 | 0x72, 0x65, 0x73, 0x73, 0x20, 0x61, 0x6e, 0x79, 0x20, 0x6b, 0x65, 0x79, 36 | 0x0d, 0x0a, 0x00, 0x00, 0x49, 0x4f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 37 | 0x53, 0x59, 0x53, 0x4d, 0x53, 0x44, 0x4f, 0x53, 0x20, 0x20, 0x20, 0x53, 38 | 0x59, 0x53, 0x7f, 0x01, 0x00, 0x41, 0xbb, 0x00, 0x07, 0x60, 0x66, 0x6a, 39 | 0x00, 0xe9, 0x3b, 0xff, 0x00, 0x00, 0x55, 0xaa 40 | }; 41 | 42 | -------------------------------------------------------------------------------- /inc/br_fat16_0x3e.h: -------------------------------------------------------------------------------- 1 | unsigned char br_fat16_0x3e[] = { 2 | 0xfa, 0x33, 3 | 0xc9, 0x8e, 0xd1, 0xbc, 0xfc, 0x7b, 0x16, 0x07, 0xbd, 0x78, 0x00, 0xc5, 0x76, 0x00, 0x1e, 0x56, 4 | 0x16, 0x55, 0xbf, 0x22, 0x05, 0x89, 0x7e, 0x00, 0x89, 0x4e, 0x02, 0xb1, 0x0b, 0xfc, 0xf3, 0xa4, 5 | 0x06, 0x1f, 0xbd, 0x00, 0x7c, 0xc6, 0x45, 0xfe, 0x0f, 0x8b, 0x46, 0x18, 0x88, 0x45, 0xf9, 0x38, 6 | 0x4e, 0x24, 0x7d, 0x22, 0x8b, 0xc1, 0x99, 0xe8, 0x77, 0x01, 0x72, 0x1a, 0x83, 0xeb, 0x3a, 0x66, 7 | 0xa1, 0x1c, 0x7c, 0x66, 0x3b, 0x07, 0x8a, 0x57, 0xfc, 0x75, 0x06, 0x80, 0xca, 0x02, 0x88, 0x56, 8 | 0x02, 0x80, 0xc3, 0x10, 0x73, 0xed, 0x33, 0xc9, 0x8a, 0x46, 0x10, 0x98, 0xf7, 0x66, 0x16, 0x03, 9 | 0x46, 0x1c, 0x13, 0x56, 0x1e, 0x03, 0x46, 0x0e, 0x13, 0xd1, 0x8b, 0x76, 0x11, 0x60, 0x89, 0x46, 10 | 0xfc, 0x89, 0x56, 0xfe, 0xb8, 0x20, 0x00, 0xf7, 0xe6, 0x8b, 0x5e, 0x0b, 0x03, 0xc3, 0x48, 0xf7, 11 | 0xf3, 0x01, 0x46, 0xfc, 0x11, 0x4e, 0xfe, 0x61, 0xbf, 0x00, 0x07, 0xe8, 0x23, 0x01, 0x72, 0x39, 12 | 0x38, 0x2d, 0x74, 0x17, 0x60, 0xb1, 0x0b, 0xbe, 0xd8, 0x7d, 0xf3, 0xa6, 0x61, 0x74, 0x39, 0x4e, 13 | 0x74, 0x09, 0x83, 0xc7, 0x20, 0x3b, 0xfb, 0x72, 0xe7, 0xeb, 0xdd, 0xbe, 0x7f, 0x7d, 0xac, 0x98, 14 | 0x03, 0xf0, 0xac, 0x84, 0xc0, 0x74, 0x17, 0x3c, 0xff, 0x74, 0x09, 0xb4, 0x0e, 0xbb, 0x07, 0x00, 15 | 0xcd, 0x10, 0xeb, 0xee, 0xbe, 0x82, 0x7d, 0xeb, 0xe5, 0xbe, 0x80, 0x7d, 0xeb, 0xe0, 0x98, 0xcd, 16 | 0x16, 0x5e, 0x1f, 0x66, 0x8f, 0x04, 0xcd, 0x19, 0xbe, 0x81, 0x7d, 0x8b, 0x7d, 0x1a, 0x8d, 0x45, 17 | 0xfe, 0x8a, 0x4e, 0x0d, 0xf7, 0xe1, 0x03, 0x46, 0xfc, 0x13, 0x56, 0xfe, 0xb1, 0x04, 0xe8, 0xc1, 18 | 0x00, 0x72, 0xd6, 0xea, 0x00, 0x02, 0x70, 0x00, 0xb4, 0x42, 0xeb, 0x2d, 0x60, 0x66, 0x6a, 0x00, 19 | 0x52, 0x50, 0x06, 0x53, 0x6a, 0x01, 0x6a, 0x10, 0x8b, 0xf4, 0x74, 0xec, 0x91, 0x92, 0x33, 0xd2, 20 | 0xf7, 0x76, 0x18, 0x91, 0xf7, 0x76, 0x18, 0x42, 0x87, 0xca, 0xf7, 0x76, 0x1a, 0x8a, 0xf2, 0x8a, 21 | 0xe8, 0xc0, 0xcc, 0x02, 0x0a, 0xcc, 0xb8, 0x01, 0x02, 0x8a, 0x56, 0x24, 0xcd, 0x13, 0x8d, 0x64, 22 | 0x10, 0x61, 0x72, 0x0a, 0x40, 0x75, 0x01, 0x42, 0x03, 0x5e, 0x0b, 0x49, 0x75, 0x77, 0xc3, 0x03, 23 | 0x18, 0x01, 0x27, 0x0d, 0x0a, 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x20, 0x73, 0x79, 0x73, 24 | 0x74, 0x65, 0x6d, 0x20, 0x64, 0x69, 0x73, 0x6b, 0xff, 0x0d, 0x0a, 0x44, 0x69, 0x73, 0x6b, 0x20, 25 | 0x49, 0x2f, 0x4f, 0x20, 0x65, 0x72, 0x72, 0x6f, 0x72, 0xff, 0x0d, 0x0a, 0x52, 0x65, 0x70, 0x6c, 26 | 0x61, 0x63, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x64, 0x69, 0x73, 0x6b, 0x2c, 0x20, 0x61, 0x6e, 27 | 0x64, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x20, 0x70, 0x72, 0x65, 0x73, 0x73, 0x20, 0x61, 0x6e, 0x79, 28 | 0x20, 0x6b, 0x65, 0x79, 0x0d, 0x0a, 0x00, 0x00, 0x49, 0x4f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 29 | 0x53, 0x59, 0x53, 0x4d, 0x53, 0x44, 0x4f, 0x53, 0x20, 0x20, 0x20, 0x53, 0x59, 0x53, 0x7f, 0x01, 30 | 0x00, 0x41, 0xbb, 0x00, 0x07, 0x80, 0x7e, 0x02, 0x0e, 0xe9, 0x40, 0xff, 0x00, 0x00, 0x55, 0xaa 31 | }; 32 | 33 | -------------------------------------------------------------------------------- /inc/mbr_rufus.h: -------------------------------------------------------------------------------- 1 | /* 2 | * First 440 bytes of Rufus MBR 3 | * https://github.com/pbatard/rufus/tree/master/res/mbr 4 | * Copyright © 2012-2014 Pete Batard 5 | */ 6 | unsigned char mbr_rufus_0x0[] = { 7 | 0x41, 0x4b, 0x45, 0x4f, 0xfc, 0x31, 0xc0, 0xfa, 0x8e, 0xd0, 0xbc, 0x00, 8 | 0x7c, 0xfb, 0x89, 0xe6, 0x89, 0xe7, 0x1e, 0x06, 0x8e, 0xd8, 0xbb, 0x13, 9 | 0x04, 0x8b, 0x07, 0x48, 0x89, 0x07, 0xc1, 0xe0, 0x06, 0x2d, 0xc0, 0x07, 10 | 0x8e, 0xc0, 0xb9, 0x00, 0x02, 0xf3, 0xa4, 0x50, 0x68, 0x30, 0x7c, 0xcb, 11 | 0x8e, 0xd8, 0x66, 0x31, 0xdb, 0x8e, 0xc3, 0x41, 0xba, 0x81, 0x00, 0xe8, 12 | 0x89, 0x00, 0x72, 0x6d, 0xbb, 0xbe, 0x7d, 0xb9, 0x04, 0x00, 0x26, 0x80, 13 | 0x3f, 0x00, 0x7c, 0x09, 0x75, 0x05, 0x83, 0xc3, 0x10, 0xe2, 0xf3, 0xeb, 14 | 0x58, 0xbe, 0x94, 0x7d, 0xe8, 0xda, 0x00, 0xe8, 0xca, 0x00, 0xba, 0x5a, 15 | 0x7d, 0xbe, 0x6e, 0x7d, 0xe8, 0xa0, 0x00, 0xb4, 0x01, 0xcd, 0x16, 0x75, 16 | 0x3d, 0xb4, 0x02, 0xcd, 0x16, 0x24, 0x04, 0x75, 0x38, 0x80, 0x3e, 0x93, 17 | 0x7d, 0x00, 0x7f, 0x0b, 0xbe, 0xb4, 0x7d, 0xe8, 0xb3, 0x00, 0xc6, 0x06, 18 | 0x93, 0x7d, 0x12, 0x80, 0x3e, 0x92, 0x7d, 0x00, 0x75, 0xd9, 0xe8, 0x89, 19 | 0x00, 0xc6, 0x06, 0xbe, 0x7d, 0x81, 0x68, 0x80, 0x00, 0xba, 0x72, 0x7d, 20 | 0xbe, 0x7e, 0x7d, 0xe8, 0x65, 0x00, 0x5a, 0x07, 0x1f, 0xea, 0x00, 0x7c, 21 | 0x00, 0x00, 0xe8, 0x6d, 0x00, 0xe8, 0x78, 0x00, 0xbb, 0xbe, 0x7d, 0x8b, 22 | 0x17, 0x52, 0xb2, 0x80, 0x8b, 0x4f, 0x02, 0x66, 0x8b, 0x5f, 0x08, 0xe8, 23 | 0x05, 0x00, 0x73, 0xd5, 0x07, 0x1f, 0xcb, 0x60, 0xb4, 0x41, 0xbb, 0xaa, 24 | 0x55, 0xcd, 0x13, 0x72, 0x2c, 0x81, 0xfb, 0x55, 0xaa, 0x75, 0x26, 0xf7, 25 | 0xc1, 0x01, 0x00, 0x74, 0x20, 0x61, 0x1e, 0x66, 0x31, 0xc0, 0x8e, 0xd8, 26 | 0x66, 0x50, 0x66, 0x53, 0x50, 0x68, 0x00, 0x7c, 0x40, 0x50, 0x6a, 0x10, 27 | 0x89, 0xe6, 0xb4, 0x42, 0xcd, 0x13, 0x9f, 0x83, 0xc4, 0x10, 0x9e, 0x1f, 28 | 0xc3, 0x61, 0xbb, 0x00, 0x7c, 0xb8, 0x01, 0x02, 0xcd, 0x13, 0xc3, 0xfa, 29 | 0x8b, 0x1c, 0x26, 0x66, 0x8b, 0x07, 0x66, 0x89, 0x04, 0x26, 0x89, 0x17, 30 | 0x26, 0x8c, 0x4f, 0x02, 0xfb, 0xc3, 0xfa, 0xbb, 0x20, 0x00, 0x66, 0xa1, 31 | 0x6e, 0x7d, 0x26, 0x66, 0x89, 0x07, 0xfb, 0xc3, 0xb4, 0x01, 0xcd, 0x16, 32 | 0x74, 0x06, 0xb4, 0x00, 0xcd, 0x16, 0xe2, 0xf4, 0xc3, 0xac, 0x3c, 0x00, 33 | 0x74, 0x09, 0xb4, 0x0e, 0xbb, 0x07, 0x00, 0xcd, 0x10, 0xeb, 0xf2, 0xc3, 34 | 0x50, 0x2e, 0xa0, 0xbe, 0x7d, 0x80, 0xfa, 0x80, 0x75, 0x04, 0x88, 0xc2, 35 | 0xeb, 0x06, 0x38, 0xc2, 0x75, 0x02, 0xb2, 0x80, 0x58, 0xc3, 0xfa, 0x2e, 36 | 0x80, 0x3e, 0x92, 0x7d, 0x00, 0x74, 0x0a, 0x2e, 0xfe, 0x0e, 0x93, 0x7d, 37 | 0x2e, 0xfe, 0x0e, 0x92, 0x7d, 0xea, 0x20, 0x00, 0x00, 0x00, 0x9c, 0x2e, 38 | 0xfe, 0x06, 0x91, 0x7d, 0x75, 0x03, 0xe8, 0xc7, 0xff, 0x9a, 0x4c, 0x00, 39 | 0x00, 0x00, 0x9c, 0x2e, 0xfe, 0x0e, 0x91, 0x7d, 0x79, 0x03, 0xe8, 0xb7, 40 | 0xff, 0x9d, 0xca, 0x02, 0x00, 0xff, 0x49, 0x12, 0x0d, 0x0a, 0x50, 0x72, 41 | 0x65, 0x73, 0x73, 0x20, 0x61, 0x6e, 0x79, 0x20, 0x6b, 0x65, 0x79, 0x20, 42 | 0x74, 0x6f, 0x20, 0x62, 0x6f, 0x6f, 0x74, 0x20, 0x66, 0x72, 0x6f, 0x6d, 43 | 0x20, 0x55, 0x53, 0x42, 0x2e, 0x00, 0x00, 0x00 44 | }; 45 | -------------------------------------------------------------------------------- /inc/br_fat16fd_0x3e.h: -------------------------------------------------------------------------------- 1 | /* br_fat16_0x3e.h 2 | // 3 | // ANI 4 | // substring gmbh/tw 14.9.04 5 | // modified bootsector 0x03e - 0x200 to support FreeDOS 6 | */ 7 | unsigned char br_fat16_0x3e[] = { 0xfa, 0xfc, 8 | 0x31, 0xc0, 0x8e, 0xd8, 0xbd, 0x00, 0x7c, 0xb8, 0xe0, 0x1f, 0x8e, 0xc0, 0x89, 0xee, 0x89, 0xef, 9 | 0xb9, 0x00, 0x01, 0xf3, 0xa5, 0xea, 0x5e, 0x7c, 0xe0, 0x1f, 0x00, 0x00, 0x60, 0x00, 0x8e, 0xd8, 10 | 0x8e, 0xd0, 0x8d, 0x66, 0xa0, 0xfb, 0x80, 0x7e, 0x24, 0xff, 0x75, 0x03, 0x88, 0x56, 0x24, 0xc7, 11 | 0x46, 0xc0, 0x10, 0x00, 0xc7, 0x46, 0xc2, 0x01, 0x00, 0xe8, 0xe6, 0x00, 0x46, 0x72, 0x65, 0x65, 12 | 0x44, 0x4f, 0x53, 0x00, 0x8b, 0x76, 0x1c, 0x8b, 0x7e, 0x1e, 0x03, 0x76, 0x0e, 0x83, 0xd7, 0x00, 13 | 0x89, 0x76, 0xd2, 0x89, 0x7e, 0xd4, 0x8a, 0x46, 0x10, 0x98, 0xf7, 0x66, 0x16, 0x01, 0xc6, 0x11, 14 | 0xd7, 0x89, 0x76, 0xd6, 0x89, 0x7e, 0xd8, 0x8b, 0x5e, 0x0b, 0xb1, 0x05, 0xd3, 0xeb, 0x8b, 0x46, 15 | 0x11, 0x31, 0xd2, 0xf7, 0xf3, 0x89, 0x46, 0xd0, 0x01, 0xc6, 0x83, 0xd7, 0x00, 0x89, 0x76, 0xda, 16 | 0x89, 0x7e, 0xdc, 0x8b, 0x46, 0xd6, 0x8b, 0x56, 0xd8, 0x8b, 0x7e, 0xd0, 0xc4, 0x5e, 0x5a, 0xe8, 17 | 0x98, 0x00, 0x72, 0x2f, 0xc4, 0x7e, 0x5a, 0xb9, 0x0b, 0x00, 0xbe, 0xf1, 0x7d, 0x57, 0xf3, 0xa6, 18 | 0x5f, 0x26, 0x8b, 0x45, 0x1a, 0x74, 0x0b, 0x83, 0xc7, 0x20, 0x26, 0x80, 0x3d, 0x00, 0x75, 0xe7, 19 | 0x72, 0x56, 0x50, 0xc4, 0x5e, 0x5a, 0x8b, 0x7e, 0x16, 0x8b, 0x46, 0xd2, 0x8b, 0x56, 0xd4, 0xe8, 20 | 0x68, 0x00, 0x58, 0x72, 0x43, 0x1e, 0x07, 0x8e, 0x5e, 0x5c, 0xbf, 0x00, 0x20, 0xab, 0x89, 0xc6, 21 | 0x8b, 0x56, 0x5c, 0x01, 0xf6, 0x73, 0x03, 0x80, 0xc6, 0x10, 0x8e, 0xda, 0xad, 0x3d, 0xf8, 0xff, 22 | 0x72, 0xeb, 0x31, 0xc0, 0xab, 0x0e, 0x1f, 0xc4, 0x5e, 0x5a, 0xbe, 0x00, 0x20, 0xad, 0x09, 0xc0, 23 | 0x74, 0x24, 0x48, 0x48, 0x8b, 0x7e, 0x0d, 0x81, 0xe7, 0xff, 0x00, 0xf7, 0xe7, 0x03, 0x46, 0xda, 24 | 0x13, 0x56, 0xdc, 0xe8, 0x24, 0x00, 0x73, 0xe5, 0xe8, 0x17, 0x00, 0x20, 0x65, 0x72, 0x72, 0x00, 25 | 0x30, 0xe4, 0xcd, 0x16, 0xcd, 0x19, 0x8a, 0x5e, 0x24, 0xff, 0x6e, 0x5a, 0x31, 0xdb, 0xb4, 0x0e, 26 | 0xcd, 0x10, 0x5e, 0xac, 0x56, 0x3c, 0x00, 0x75, 0xf3, 0xc3, 0x56, 0x89, 0x46, 0xc8, 0x89, 0x56, 27 | 0xca, 0x8c, 0x46, 0xc6, 0x89, 0x5e, 0xc4, 0xb4, 0x41, 0xbb, 0xaa, 0x55, 0x8a, 0x56, 0x24, 0x84, 28 | 0xd2, 0x74, 0x19, 0xcd, 0x13, 0x72, 0x15, 0xd1, 0xe9, 0x81, 0xdb, 0x54, 0xaa, 0x75, 0x0d, 0x8d, 29 | 0x76, 0xc0, 0x89, 0x5e, 0xcc, 0x89, 0x5e, 0xce, 0xb4, 0x42, 0xeb, 0x2c, 0x8b, 0x4e, 0xc8, 0x8b, 30 | 0x56, 0xca, 0x8a, 0x46, 0x18, 0xf6, 0x66, 0x1a, 0x91, 0xf7, 0xf1, 0x92, 0xf6, 0x76, 0x18, 0x89, 31 | 0xd1, 0x88, 0xc6, 0x86, 0xe9, 0xd0, 0xc9, 0xd0, 0xc9, 0x8a, 0x46, 0x18, 0x28, 0xe0, 0xfe, 0xc4, 32 | 0x08, 0xe1, 0xc4, 0x5e, 0xc4, 0xb8, 0x01, 0x02, 0x8a, 0x56, 0x24, 0xcd, 0x13, 0x73, 0x06, 0x30, 33 | 0xe4, 0xcd, 0x13, 0xeb, 0xa2, 0x8b, 0x46, 0x0b, 0xf6, 0x76, 0xc0, 0x01, 0x46, 0xc6, 0x83, 0x46, 34 | 0xc8, 0x01, 0x83, 0x56, 0xca, 0x00, 0x4f, 0x75, 0xea, 0x8e, 0x46, 0xc6, 0x5e, 0xc3, 0x00, 0x00, 35 | 0x00, 0x4b, 0x45, 0x52, 0x4e, 0x45, 0x4c, 0x20, 0x20, 0x53, 0x59, 0x53, 0x00, 0x00, 0x55, 0xaa 36 | }; 37 | 38 | -------------------------------------------------------------------------------- /inc/mbr_grub2.h: -------------------------------------------------------------------------------- 1 | /* 2 | * First 432 bytes of MBR from Grub2 (boot.img), with 2 bytes NOPed @0x66 3 | * as per grub2's setup.c comments: 4 | * If DEST_DRIVE is a hard disk, enable the workaround, which is 5 | * for buggy BIOSes which don't pass boot drive correctly. Instead, 6 | * they pass 0x00 or 0x01 even when booted from 0x80. 7 | */ 8 | 9 | unsigned char mbr_grub2_0x0[] = { 10 | 0xEB, 0x63, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 11 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 12 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 13 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 14 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 15 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 16 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 17 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 18 | 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFA, 0x90, 0x90, 0xF6, 0xC2, 0x80, 0x74, 19 | 0x05, 0xF6, 0xC2, 0x70, 0x74, 0x02, 0xB2, 0x80, 0xEA, 0x79, 0x7C, 0x00, 20 | 0x00, 0x31, 0xC0, 0x8E, 0xD8, 0x8E, 0xD0, 0xBC, 0x00, 0x20, 0xFB, 0xA0, 21 | 0x64, 0x7C, 0x3C, 0xFF, 0x74, 0x02, 0x88, 0xC2, 0x52, 0xBE, 0x80, 0x7D, 22 | 0xE8, 0x17, 0x01, 0xBE, 0x05, 0x7C, 0xB4, 0x41, 0xBB, 0xAA, 0x55, 0xCD, 23 | 0x13, 0x5A, 0x52, 0x72, 0x3D, 0x81, 0xFB, 0x55, 0xAA, 0x75, 0x37, 0x83, 24 | 0xE1, 0x01, 0x74, 0x32, 0x31, 0xC0, 0x89, 0x44, 0x04, 0x40, 0x88, 0x44, 25 | 0xFF, 0x89, 0x44, 0x02, 0xC7, 0x04, 0x10, 0x00, 0x66, 0x8B, 0x1E, 0x5C, 26 | 0x7C, 0x66, 0x89, 0x5C, 0x08, 0x66, 0x8B, 0x1E, 0x60, 0x7C, 0x66, 0x89, 27 | 0x5C, 0x0C, 0xC7, 0x44, 0x06, 0x00, 0x70, 0xB4, 0x42, 0xCD, 0x13, 0x72, 28 | 0x05, 0xBB, 0x00, 0x70, 0xEB, 0x76, 0xB4, 0x08, 0xCD, 0x13, 0x73, 0x0D, 29 | 0x5A, 0x84, 0xD2, 0x0F, 0x83, 0xD8, 0x00, 0xBE, 0x8B, 0x7D, 0xE9, 0x82, 30 | 0x00, 0x66, 0x0F, 0xB6, 0xC6, 0x88, 0x64, 0xFF, 0x40, 0x66, 0x89, 0x44, 31 | 0x04, 0x0F, 0xB6, 0xD1, 0xC1, 0xE2, 0x02, 0x88, 0xE8, 0x88, 0xF4, 0x40, 32 | 0x89, 0x44, 0x08, 0x0F, 0xB6, 0xC2, 0xC0, 0xE8, 0x02, 0x66, 0x89, 0x04, 33 | 0x66, 0xA1, 0x60, 0x7C, 0x66, 0x09, 0xC0, 0x75, 0x4E, 0x66, 0xA1, 0x5C, 34 | 0x7C, 0x66, 0x31, 0xD2, 0x66, 0xF7, 0x34, 0x88, 0xD1, 0x31, 0xD2, 0x66, 35 | 0xF7, 0x74, 0x04, 0x3B, 0x44, 0x08, 0x7D, 0x37, 0xFE, 0xC1, 0x88, 0xC5, 36 | 0x30, 0xC0, 0xC1, 0xE8, 0x02, 0x08, 0xC1, 0x88, 0xD0, 0x5A, 0x88, 0xC6, 37 | 0xBB, 0x00, 0x70, 0x8E, 0xC3, 0x31, 0xDB, 0xB8, 0x01, 0x02, 0xCD, 0x13, 38 | 0x72, 0x1E, 0x8C, 0xC3, 0x60, 0x1E, 0xB9, 0x00, 0x01, 0x8E, 0xDB, 0x31, 39 | 0xF6, 0xBF, 0x00, 0x80, 0x8E, 0xC6, 0xFC, 0xF3, 0xA5, 0x1F, 0x61, 0xFF, 40 | 0x26, 0x5A, 0x7C, 0xBE, 0x86, 0x7D, 0xEB, 0x03, 0xBE, 0x95, 0x7D, 0xE8, 41 | 0x34, 0x00, 0xBE, 0x9A, 0x7D, 0xE8, 0x2E, 0x00, 0xCD, 0x18, 0xEB, 0xFE, 42 | 0x47, 0x52, 0x55, 0x42, 0x20, 0x00, 0x47, 0x65, 0x6F, 0x6D, 0x00, 0x48, 43 | 0x61, 0x72, 0x64, 0x20, 0x44, 0x69, 0x73, 0x6B, 0x00, 0x52, 0x65, 0x61, 44 | 0x64, 0x00, 0x20, 0x45, 0x72, 0x72, 0x6F, 0x72, 0x0D, 0x0A, 0x00, 0xBB, 45 | 0x01, 0x00, 0xB4, 0x0E, 0xCD, 0x10, 0xAC, 0x3C, 0x00, 0x75, 0xF4, 0xC3 46 | }; 47 | -------------------------------------------------------------------------------- /inc/mbr_dos.h: -------------------------------------------------------------------------------- 1 | /* First 446 bytes of MBR from Dos 3.3 onwards and Windows 95A */ 2 | unsigned char mbr_dos_0x0[] = { 3 | 0xfa, 0x33, 0xc0, 0x8e, 0xd0, 0xbc, 0x00, 0x7c, 0x8b, 0xf4, 0x50, 0x07, 4 | 0x50, 0x1f, 0xfb, 0xfc, 0xbf, 0x00, 0x06, 0xb9, 0x00, 0x01, 0xf3, 0xa5, 5 | 0xea, 0x1d, 0x06, 0x00, 0x00, 0xbe, 0xbe, 0x07, 0xb3, 0x04, 0x80, 0x3c, 6 | 0x80, 0x74, 0x0e, 0x80, 0x3c, 0x00, 0x75, 0x1c, 0x83, 0xc6, 0x10, 0xfe, 7 | 0xcb, 0x75, 0xef, 0xcd, 0x18, 0x8b, 0x14, 0x8b, 0x4c, 0x02, 0x8b, 0xee, 8 | 0x83, 0xc6, 0x10, 0xfe, 0xcb, 0x74, 0x1a, 0x80, 0x3c, 0x00, 0x74, 0xf4, 9 | 0xbe, 0x8b, 0x06, 0xac, 0x3c, 0x00, 0x74, 0x0b, 0x56, 0xbb, 0x07, 0x00, 10 | 0xb4, 0x0e, 0xcd, 0x10, 0x5e, 0xeb, 0xf0, 0xeb, 0xfe, 0xbf, 0x05, 0x00, 11 | 0xbb, 0x00, 0x7c, 0xb8, 0x01, 0x02, 0x57, 0xcd, 0x13, 0x5f, 0x73, 0x0c, 12 | 0x33, 0xc0, 0xcd, 0x13, 0x4f, 0x75, 0xed, 0xbe, 0xa3, 0x06, 0xeb, 0xd3, 13 | 0xbe, 0xc2, 0x06, 0xbf, 0xfe, 0x7d, 0x81, 0x3d, 0x55, 0xaa, 0x75, 0xc7, 14 | 0x8b, 0xf5, 0xea, 0x00, 0x7c, 0x00, 0x00, 0x49, 0x6e, 0x76, 0x61, 0x6c, 15 | 0x69, 0x64, 0x20, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 16 | 0x20, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x00, 0x45, 0x72, 0x72, 0x6f, 0x72, 17 | 0x20, 0x6c, 0x6f, 0x61, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x6f, 0x70, 0x65, 18 | 0x72, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x73, 0x79, 0x73, 0x74, 0x65, 19 | 0x6d, 0x00, 0x4d, 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x20, 0x6f, 0x70, 20 | 0x65, 0x72, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x73, 0x79, 0x73, 0x74, 21 | 0x65, 0x6d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 22 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 23 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 24 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 25 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 26 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 27 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 28 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 29 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 30 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 31 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 32 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 33 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 34 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 35 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 36 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 37 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 38 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 39 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 40 | }; 41 | /* Next four bytes used for Windows Disk Signature / Drive serial number */ 42 | /* 43 | unsigned char mbr_dos_0x1b8[] = { 44 | 0x00, 0x00, 0x00, 0x00, 45 | 0x00, 0x00 46 | }; 47 | */ 48 | -------------------------------------------------------------------------------- /inc/br_fat32ros_0x1c00.h: -------------------------------------------------------------------------------- 1 | unsigned char br_fat32ros_0x1c00[] = { 2 | 0x66, 0x8b, 0x86, 0x2c, 0x00, 0x66, 0x3d, 0xf8, 0xff, 0xff, 0x0f, 0x72, 3 | 0x03, 0xe9, 0x6c, 0x01, 0xbb, 0x00, 0x20, 0x8e, 0xc3, 0xe8, 0x26, 0x01, 4 | 0x31, 0xdb, 0x8a, 0x9e, 0x0d, 0x00, 0xc1, 0xe3, 0x04, 0xb8, 0x00, 0x20, 5 | 0x8e, 0xc0, 0x31, 0xff, 0xbe, 0xa3, 0x7f, 0xb9, 0x0b, 0x00, 0xf3, 0xa6, 6 | 0x74, 0x2b, 0x4b, 0x75, 0x03, 0xe9, 0x44, 0x01, 0x8c, 0xc0, 0x83, 0xc0, 7 | 0x02, 0x8e, 0xc0, 0x31, 0xff, 0xbe, 0xa3, 0x7f, 0xb9, 0x0b, 0x00, 0xf3, 8 | 0xa6, 0x74, 0x12, 0x4b, 0x75, 0xea, 0x66, 0x8b, 0x86, 0x2c, 0x00, 0xe8, 9 | 0x6c, 0x00, 0x66, 0x89, 0x86, 0x2c, 0x00, 0xeb, 0xa3, 0xbe, 0xae, 0x7f, 10 | 0xe8, 0x42, 0xff, 0x31, 0xff, 0x31, 0xd2, 0x26, 0x8b, 0x45, 0x14, 0x66, 11 | 0xc1, 0xe0, 0x10, 0x26, 0x8b, 0x45, 0x1a, 0x66, 0x83, 0xf8, 0x02, 0x73, 12 | 0x03, 0xe9, 0x17, 0xff, 0x66, 0x3d, 0xf8, 0xff, 0xff, 0x0f, 0x72, 0x03, 13 | 0xe9, 0x0c, 0xff, 0xbb, 0x80, 0x0f, 0x8e, 0xc3, 0x66, 0x3d, 0xf8, 0xff, 14 | 0xff, 0x0f, 0x73, 0x21, 0x66, 0x50, 0x31, 0xdb, 0x06, 0xe8, 0xa2, 0x00, 15 | 0x07, 0x31, 0xdb, 0x8a, 0x9e, 0x0d, 0x00, 0xc1, 0xe3, 0x05, 0x8c, 0xc0, 16 | 0x01, 0xd8, 0x8e, 0xc0, 0x66, 0x58, 0x06, 0xe8, 0x10, 0x00, 0x07, 0xeb, 17 | 0xd7, 0x8a, 0x96, 0x40, 0x00, 0x8a, 0x36, 0xfd, 0x7d, 0xea, 0x00, 0xf8, 18 | 0x00, 0x00, 0x66, 0xc1, 0xe0, 0x02, 0x66, 0x89, 0xc1, 0x66, 0x31, 0xd2, 19 | 0x66, 0x0f, 0xb7, 0x9e, 0x0b, 0x00, 0x66, 0x53, 0x66, 0xf7, 0xf3, 0x66, 20 | 0x0f, 0xb7, 0x9e, 0x0e, 0x00, 0x66, 0x01, 0xd8, 0x66, 0x8b, 0x9e, 0x1c, 21 | 0x00, 0x66, 0x01, 0xd8, 0x66, 0x5b, 0x66, 0x4b, 0x66, 0x21, 0xd9, 0x66, 22 | 0x0f, 0xb7, 0x9e, 0x28, 0x00, 0x83, 0xe3, 0x0f, 0x74, 0x18, 0x3a, 0x9e, 23 | 0x10, 0x00, 0x72, 0x03, 0xe9, 0x90, 0xfe, 0x66, 0x50, 0x66, 0x8b, 0x86, 24 | 0x24, 0x00, 0x66, 0xf7, 0xe3, 0x66, 0x5a, 0x66, 0x01, 0xd0, 0x66, 0x51, 25 | 0xbb, 0x00, 0x90, 0x8e, 0xc3, 0x66, 0x3b, 0x06, 0x3a, 0x7f, 0x74, 0x0c, 26 | 0x66, 0xa3, 0x3a, 0x7f, 0x31, 0xdb, 0xb9, 0x01, 0x00, 0xe8, 0xaf, 0xfd, 27 | 0x66, 0x59, 0x26, 0x67, 0x66, 0x8b, 0x01, 0x66, 0x25, 0xff, 0xff, 0xff, 28 | 0x0f, 0xc3, 0xff, 0xff, 0xff, 0xff, 0x66, 0x48, 0x66, 0x48, 0x66, 0x31, 29 | 0xd2, 0x66, 0x0f, 0xb6, 0x9e, 0x0d, 0x00, 0x66, 0xf7, 0xe3, 0x66, 0x50, 30 | 0x66, 0x31, 0xd2, 0x66, 0x0f, 0xb6, 0x86, 0x10, 0x00, 0x66, 0xf7, 0xa6, 31 | 0x24, 0x00, 0x66, 0x0f, 0xb7, 0x9e, 0x0e, 0x00, 0x66, 0x01, 0xd8, 0x66, 32 | 0x03, 0x86, 0x1c, 0x00, 0x66, 0x5b, 0x66, 0x01, 0xd8, 0x31, 0xdb, 0x0f, 33 | 0xb6, 0x8e, 0x0d, 0x00, 0xe8, 0x60, 0xfd, 0xc3, 0xbe, 0x8b, 0x7f, 0xe8, 34 | 0x23, 0xfe, 0xbe, 0xd9, 0x7d, 0xe8, 0x1d, 0xfe, 0xe9, 0x0e, 0xfe, 0x66, 35 | 0x72, 0x65, 0x65, 0x6c, 0x64, 0x72, 0x2e, 0x73, 0x79, 0x73, 0x20, 0x6e, 36 | 0x6f, 0x74, 0x20, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x0d, 0x0a, 0x00, 0x46, 37 | 0x52, 0x45, 0x45, 0x4c, 0x44, 0x52, 0x20, 0x53, 0x59, 0x53, 0x4c, 0x6f, 38 | 0x61, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x46, 0x72, 0x65, 0x65, 0x4c, 0x6f, 39 | 0x61, 0x64, 0x65, 0x72, 0x2e, 0x2e, 0x2e, 0x0d, 0x0a, 0x00, 0x00, 0x00, 40 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 41 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 42 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 43 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 44 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0xaa 45 | }; 46 | -------------------------------------------------------------------------------- /inc/mbr_vista.h: -------------------------------------------------------------------------------- 1 | /* First 446 bytes of MBR from Windows Vista */ 2 | /* This is English version. Bytes 0x12c onwards vary with language. */ 3 | /* Last two bytes 1b6 and 1b7 point to language-specific messages. */ 4 | /* Support of other languages is an exercise for the reader! */ 5 | unsigned char mbr_vista_0x0[] = { 6 | 0x33, 0xc0, 0x8e, 0xd0, 0xbc, 0x00, 0x7c, 0x8e, 0xc0, 0x8e, 0xd8, 0xbe, 7 | 0x00, 0x7c, 0xbf, 0x00, 0x06, 0xb9, 0x00, 0x02, 0xfc, 0xf3, 0xa4, 0x50, 8 | 0x68, 0x1c, 0x06, 0xcb, 0xfb, 0xb9, 0x04, 0x00, 0xbd, 0xbe, 0x07, 0x80, 9 | 0x7e, 0x00, 0x00, 0x7c, 0x0b, 0x0f, 0x85, 0x10, 0x01, 0x83, 0xc5, 0x10, 10 | 0xe2, 0xf1, 0xcd, 0x18, 0x88, 0x56, 0x00, 0x55, 0xc6, 0x46, 0x11, 0x05, 11 | 0xc6, 0x46, 0x10, 0x00, 0xb4, 0x41, 0xbb, 0xaa, 0x55, 0xcd, 0x13, 0x5d, 12 | 0x72, 0x0f, 0x81, 0xfb, 0x55, 0xaa, 0x75, 0x09, 0xf7, 0xc1, 0x01, 0x00, 13 | 0x74, 0x03, 0xfe, 0x46, 0x10, 0x66, 0x60, 0x80, 0x7e, 0x10, 0x00, 0x74, 14 | 0x26, 0x66, 0x68, 0x00, 0x00, 0x00, 0x00, 0x66, 0xff, 0x76, 0x08, 0x68, 15 | 0x00, 0x00, 0x68, 0x00, 0x7c, 0x68, 0x01, 0x00, 0x68, 0x10, 0x00, 0xb4, 16 | 0x42, 0x8a, 0x56, 0x00, 0x8b, 0xf4, 0xcd, 0x13, 0x9f, 0x83, 0xc4, 0x10, 17 | 0x9e, 0xeb, 0x14, 0xb8, 0x01, 0x02, 0xbb, 0x00, 0x7c, 0x8a, 0x56, 0x00, 18 | 0x8a, 0x76, 0x01, 0x8a, 0x4e, 0x02, 0x8a, 0x6e, 0x03, 0xcd, 0x13, 0x66, 19 | 0x61, 0x73, 0x1e, 0xfe, 0x4e, 0x11, 0x0f, 0x85, 0x0c, 0x00, 0x80, 0x7e, 20 | 0x00, 0x80, 0x0f, 0x84, 0x8a, 0x00, 0xb2, 0x80, 0xeb, 0x82, 0x55, 0x32, 21 | 0xe4, 0x8a, 0x56, 0x00, 0xcd, 0x13, 0x5d, 0xeb, 0x9c, 0x81, 0x3e, 0xfe, 22 | 0x7d, 0x55, 0xaa, 0x75, 0x6e, 0xff, 0x76, 0x00, 0xe8, 0x8a, 0x00, 0x0f, 23 | 0x85, 0x15, 0x00, 0xb0, 0xd1, 0xe6, 0x64, 0xe8, 0x7f, 0x00, 0xb0, 0xdf, 24 | 0xe6, 0x60, 0xe8, 0x78, 0x00, 0xb0, 0xff, 0xe6, 0x64, 0xe8, 0x71, 0x00, 25 | 0xb8, 0x00, 0xbb, 0xcd, 0x1a, 0x66, 0x23, 0xc0, 0x75, 0x3b, 0x66, 0x81, 26 | 0xfb, 0x54, 0x43, 0x50, 0x41, 0x75, 0x32, 0x81, 0xf9, 0x02, 0x01, 0x72, 27 | 0x2c, 0x66, 0x68, 0x07, 0xbb, 0x00, 0x00, 0x66, 0x68, 0x00, 0x02, 0x00, 28 | 0x00, 0x66, 0x68, 0x08, 0x00, 0x00, 0x00, 0x66, 0x53, 0x66, 0x53, 0x66, 29 | 0x55, 0x66, 0x68, 0x00, 0x00, 0x00, 0x00, 0x66, 0x68, 0x00, 0x7c, 0x00, 30 | 0x00, 0x66, 0x61, 0x68, 0x00, 0x00, 0x07, 0xcd, 0x1a, 0x5a, 0x32, 0xf6, 31 | 0xea, 0x00, 0x7c, 0x00, 0x00, 0xcd, 0x18, 0xa0, 0xb7, 0x07, 0xeb, 0x08, 32 | 0xa0, 0xb6, 0x07, 0xeb, 0x03, 0xa0, 0xb5, 0x07, 0x32, 0xe4, 0x05, 0x00, 33 | 0x07, 0x8b, 0xf0, 0xac, 0x3c, 0x00, 0x74, 0xfc, 0xbb, 0x07, 0x00, 0xb4, 34 | 0x0e, 0xcd, 0x10, 0xeb, 0xf2, 0x2b, 0xc9, 0xe4, 0x64, 0xeb, 0x00, 0x24, 35 | 0x02, 0xe0, 0xf8, 0x24, 0x02, 0xc3, 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, 36 | 0x64, 0x20, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 37 | 0x74, 0x61, 0x62, 0x6c, 0x65, 0x00, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x20, 38 | 0x6c, 0x6f, 0x61, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x6f, 0x70, 0x65, 0x72, 39 | 0x61, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 40 | 0x00, 0x4d, 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x20, 0x6f, 0x70, 0x65, 41 | 0x72, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x73, 0x79, 0x73, 0x74, 0x65, 42 | 0x6d, 0x00, 0x00, 0x00, 0x00, 0x62, 0x7a, 0x99 43 | }; 44 | /* Next four bytes used for Windows Disk Signature / Drive serial number */ 45 | /* 46 | unsigned char mbr_vista_0x1b8[] = { 47 | 0x00, 0x00, 0x00, 0x00, 48 | 0x00, 0x00 49 | }; 50 | */ 51 | -------------------------------------------------------------------------------- /inc/br_fat32nt_0x1800.h: -------------------------------------------------------------------------------- 1 | unsigned char br_fat32nt_0x1800[] = { 2 | 0x66, 0x0f, 0xb6, 0x46, 0x10, 0x66, 0x8b, 0x4e, 0x24, 0x66, 0xf7, 0xe1, 3 | 0x66, 0x03, 0x46, 0x1c, 0x66, 0x0f, 0xb7, 0x56, 0x0e, 0x66, 0x03, 0xc2, 4 | 0x66, 0x89, 0x46, 0xfc, 0x66, 0xc7, 0x46, 0xf4, 0xff, 0xff, 0xff, 0xff, 5 | 0x66, 0x8b, 0x46, 0x2c, 0x66, 0x83, 0xf8, 0x02, 0x0f, 0x82, 0xa6, 0xfc, 6 | 0x66, 0x3d, 0xf8, 0xff, 0xff, 0x0f, 0x0f, 0x83, 0x9c, 0xfc, 0x66, 0x50, 7 | 0x66, 0x83, 0xe8, 0x02, 0x66, 0x0f, 0xb6, 0x5e, 0x0d, 0x8b, 0xf3, 0x66, 8 | 0xf7, 0xe3, 0x66, 0x03, 0x46, 0xfc, 0xbb, 0x00, 0x82, 0x8b, 0xfb, 0xb9, 9 | 0x01, 0x00, 0xe8, 0x87, 0xfc, 0x38, 0x2d, 0x74, 0x1e, 0xb1, 0x0b, 0x56, 10 | 0xbe, 0x70, 0x7d, 0xf3, 0xa6, 0x5e, 0x74, 0x1b, 0x03, 0xf9, 0x83, 0xc7, 11 | 0x15, 0x3b, 0xfb, 0x72, 0xe8, 0x4e, 0x75, 0xda, 0x66, 0x58, 0xe8, 0x65, 12 | 0x00, 0x72, 0xbf, 0x83, 0xc4, 0x04, 0xe9, 0x55, 0xfc, 0x00, 0x20, 0x83, 13 | 0xc4, 0x04, 0x8b, 0x75, 0x09, 0x8b, 0x7d, 0x0f, 0x8b, 0xc6, 0x66, 0xc1, 14 | 0xe0, 0x10, 0x8b, 0xc7, 0x66, 0x83, 0xf8, 0x02, 0x0f, 0x82, 0x3a, 0xfc, 15 | 0x66, 0x3d, 0xf8, 0xff, 0xff, 0x0f, 0x0f, 0x83, 0x30, 0xfc, 0x66, 0x50, 16 | 0x66, 0x83, 0xe8, 0x02, 0x66, 0x0f, 0xb6, 0x4e, 0x0d, 0x66, 0xf7, 0xe1, 17 | 0x66, 0x03, 0x46, 0xfc, 0xbb, 0x00, 0x00, 0x06, 0x8e, 0x06, 0x81, 0x80, 18 | 0xe8, 0x1d, 0xfc, 0x07, 0x66, 0x58, 0xc1, 0xeb, 0x04, 0x01, 0x1e, 0x81, 19 | 0x80, 0xe8, 0x0e, 0x00, 0x0f, 0x83, 0x02, 0x00, 0x72, 0xd0, 0x8a, 0x56, 20 | 0x40, 0xea, 0x00, 0x00, 0x00, 0x20, 0x66, 0xc1, 0xe0, 0x02, 0xe8, 0x11, 21 | 0x00, 0x26, 0x66, 0x8b, 0x01, 0x66, 0x25, 0xff, 0xff, 0xff, 0x0f, 0x66, 22 | 0x3d, 0xf8, 0xff, 0xff, 0x0f, 0xc3, 0xbf, 0x00, 0x7e, 0x66, 0x0f, 0xb7, 23 | 0x4e, 0x0b, 0x66, 0x33, 0xd2, 0x66, 0xf7, 0xf1, 0x66, 0x3b, 0x46, 0xf4, 24 | 0x74, 0x3a, 0x66, 0x89, 0x46, 0xf4, 0x66, 0x03, 0x46, 0x1c, 0x66, 0x0f, 25 | 0xb7, 0x4e, 0x0e, 0x66, 0x03, 0xc1, 0x66, 0x0f, 0xb7, 0x5e, 0x28, 0x83, 26 | 0xe3, 0x0f, 0x74, 0x16, 0x3a, 0x5e, 0x10, 0x0f, 0x83, 0xab, 0xfb, 0x52, 27 | 0x66, 0x8b, 0xc8, 0x66, 0x8b, 0x46, 0x24, 0x66, 0xf7, 0xe3, 0x66, 0x03, 28 | 0xc1, 0x5a, 0x52, 0x8b, 0xdf, 0xb9, 0x01, 0x00, 0xe8, 0x9d, 0xfb, 0x5a, 29 | 0x8b, 0xda, 0xc3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 30 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 31 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 32 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 33 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 34 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 35 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 36 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 37 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 38 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 39 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 40 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 41 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 42 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 43 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 44 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0xaa 45 | }; 46 | -------------------------------------------------------------------------------- /inc/br_fat32pe_0x1800.h: -------------------------------------------------------------------------------- 1 | unsigned char br_fat32pe_0x1800[] = { 2 | 0x66, 0x0f, 0xb6, 0x46, 0x10, 0x66, 0x8b, 0x4e, 0x24, 0x66, 0xf7, 0xe1, 3 | 0x66, 0x03, 0x46, 0x1c, 0x66, 0x0f, 0xb7, 0x56, 0x0e, 0x66, 0x03, 0xc2, 4 | 0x66, 0x89, 0x46, 0xfc, 0x66, 0xc7, 0x46, 0xf4, 0xff, 0xff, 0xff, 0xff, 5 | 0x66, 0x8b, 0x46, 0x2c, 0x66, 0x83, 0xf8, 0x02, 0x0f, 0x82, 0xc2, 0xfc, 6 | 0x66, 0x3d, 0xf8, 0xff, 0xff, 0x0f, 0x0f, 0x83, 0xb8, 0xfc, 0x66, 0x50, 7 | 0x66, 0x83, 0xe8, 0x02, 0x66, 0x0f, 0xb6, 0x5e, 0x0d, 0x8b, 0xf3, 0x66, 8 | 0xf7, 0xe3, 0x66, 0x03, 0x46, 0xfc, 0xbb, 0x00, 0x82, 0x8b, 0xfb, 0xb9, 9 | 0x01, 0x00, 0xe8, 0xa3, 0xfc, 0x38, 0x2d, 0x74, 0x1e, 0xb1, 0x0b, 0x56, 10 | 0xbe, 0x69, 0x7d, 0xf3, 0xa6, 0x5e, 0x74, 0x1b, 0x03, 0xf9, 0x83, 0xc7, 11 | 0x15, 0x3b, 0xfb, 0x72, 0xe8, 0x4e, 0x75, 0xda, 0x66, 0x58, 0xe8, 0x65, 12 | 0x00, 0x72, 0xbf, 0x83, 0xc4, 0x04, 0xe9, 0x71, 0xfc, 0x00, 0x20, 0x83, 13 | 0xc4, 0x04, 0x8b, 0x75, 0x09, 0x8b, 0x7d, 0x0f, 0x8b, 0xc6, 0x66, 0xc1, 14 | 0xe0, 0x10, 0x8b, 0xc7, 0x66, 0x83, 0xf8, 0x02, 0x0f, 0x82, 0x56, 0xfc, 15 | 0x66, 0x3d, 0xf8, 0xff, 0xff, 0x0f, 0x0f, 0x83, 0x4c, 0xfc, 0x66, 0x50, 16 | 0x66, 0x83, 0xe8, 0x02, 0x66, 0x0f, 0xb6, 0x4e, 0x0d, 0x66, 0xf7, 0xe1, 17 | 0x66, 0x03, 0x46, 0xfc, 0xbb, 0x00, 0x00, 0x06, 0x8e, 0x06, 0x81, 0x80, 18 | 0xe8, 0x39, 0xfc, 0x07, 0x66, 0x58, 0xc1, 0xeb, 0x04, 0x01, 0x1e, 0x81, 19 | 0x80, 0xe8, 0x0e, 0x00, 0x0f, 0x83, 0x02, 0x00, 0x72, 0xd0, 0x8a, 0x56, 20 | 0x40, 0xea, 0x00, 0x00, 0x00, 0x20, 0x66, 0xc1, 0xe0, 0x02, 0xe8, 0x11, 21 | 0x00, 0x26, 0x66, 0x8b, 0x01, 0x66, 0x25, 0xff, 0xff, 0xff, 0x0f, 0x66, 22 | 0x3d, 0xf8, 0xff, 0xff, 0x0f, 0xc3, 0xbf, 0x00, 0x7e, 0x66, 0x0f, 0xb7, 23 | 0x4e, 0x0b, 0x66, 0x33, 0xd2, 0x66, 0xf7, 0xf1, 0x66, 0x3b, 0x46, 0xf4, 24 | 0x74, 0x3a, 0x66, 0x89, 0x46, 0xf4, 0x66, 0x03, 0x46, 0x1c, 0x66, 0x0f, 25 | 0xb7, 0x4e, 0x0e, 0x66, 0x03, 0xc1, 0x66, 0x0f, 0xb7, 0x5e, 0x28, 0x83, 26 | 0xe3, 0x0f, 0x74, 0x16, 0x3a, 0x5e, 0x10, 0x0f, 0x83, 0xc7, 0xfb, 0x52, 27 | 0x66, 0x8b, 0xc8, 0x66, 0x8b, 0x46, 0x24, 0x66, 0xf7, 0xe3, 0x66, 0x03, 28 | 0xc1, 0x5a, 0x52, 0x8b, 0xdf, 0xb9, 0x01, 0x00, 0xe8, 0xb9, 0xfb, 0x5a, 29 | 0x8b, 0xda, 0xc3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 30 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 31 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 32 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 33 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 34 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 35 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 36 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 37 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 38 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 39 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 40 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 41 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 42 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 43 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 44 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0xaa 45 | }; 46 | -------------------------------------------------------------------------------- /inc/mbr_win7.h: -------------------------------------------------------------------------------- 1 | /* First 446 bytes of MBR from Windows 7 */ 2 | /* This is English version. Bytes 0x12c onwards vary with language. */ 3 | /* Last two bytes 1b6 and 1b7 point to language-specific messages. */ 4 | /* Support of other languages is an exercise for the reader! */ 5 | unsigned char mbr_win7_0x0[] = { 6 | 0x33, 0xc0, 0x8e, 0xd0, 0xbc, 0x00, 0x7c, 0x8e, 0xc0, 0x8e, 0xd8, 0xbe, 7 | 0x00, 0x7c, 0xbf, 0x00, 0x06, 0xb9, 0x00, 0x02, 0xfc, 0xf3, 0xa4, 0x50, 8 | 0x68, 0x1c, 0x06, 0xcb, 0xfb, 0xb9, 0x04, 0x00, 0xbd, 0xbe, 0x07, 0x80, 9 | 0x7e, 0x00, 0x00, 0x7c, 0x0b, 0x0f, 0x85, 0x0e, 0x01, 0x83, 0xc5, 0x10, 10 | 0xe2, 0xf1, 0xcd, 0x18, 0x88, 0x56, 0x00, 0x55, 0xc6, 0x46, 0x11, 0x05, 11 | 0xc6, 0x46, 0x10, 0x00, 0xb4, 0x41, 0xbb, 0xaa, 0x55, 0xcd, 0x13, 0x5d, 12 | 0x72, 0x0f, 0x81, 0xfb, 0x55, 0xaa, 0x75, 0x09, 0xf7, 0xc1, 0x01, 0x00, 13 | 0x74, 0x03, 0xfe, 0x46, 0x10, 0x66, 0x60, 0x80, 0x7e, 0x10, 0x00, 0x74, 14 | 0x26, 0x66, 0x68, 0x00, 0x00, 0x00, 0x00, 0x66, 0xff, 0x76, 0x08, 0x68, 15 | 0x00, 0x00, 0x68, 0x00, 0x7c, 0x68, 0x01, 0x00, 0x68, 0x10, 0x00, 0xb4, 16 | 0x42, 0x8a, 0x56, 0x00, 0x8b, 0xf4, 0xcd, 0x13, 0x9f, 0x83, 0xc4, 0x10, 17 | 0x9e, 0xeb, 0x14, 0xb8, 0x01, 0x02, 0xbb, 0x00, 0x7c, 0x8a, 0x56, 0x00, 18 | 0x8a, 0x76, 0x01, 0x8a, 0x4e, 0x02, 0x8a, 0x6e, 0x03, 0xcd, 0x13, 0x66, 19 | 0x61, 0x73, 0x1c, 0xfe, 0x4e, 0x11, 0x75, 0x0c, 0x80, 0x7e, 0x00, 0x80, 20 | 0x0f, 0x84, 0x8a, 0x00, 0xb2, 0x80, 0xeb, 0x84, 0x55, 0x32, 0xe4, 0x8a, 21 | 0x56, 0x00, 0xcd, 0x13, 0x5d, 0xeb, 0x9e, 0x81, 0x3e, 0xfe, 0x7d, 0x55, 22 | 0xaa, 0x75, 0x6e, 0xff, 0x76, 0x00, 0xe8, 0x8d, 0x00, 0x75, 0x17, 0xfa, 23 | 0xb0, 0xd1, 0xe6, 0x64, 0xe8, 0x83, 0x00, 0xb0, 0xdf, 0xe6, 0x60, 0xe8, 24 | 0x7c, 0x00, 0xb0, 0xff, 0xe6, 0x64, 0xe8, 0x75, 0x00, 0xfb, 0xb8, 0x00, 25 | 0xbb, 0xcd, 0x1a, 0x66, 0x23, 0xc0, 0x75, 0x3b, 0x66, 0x81, 0xfb, 0x54, 26 | 0x43, 0x50, 0x41, 0x75, 0x32, 0x81, 0xf9, 0x02, 0x01, 0x72, 0x2c, 0x66, 27 | 0x68, 0x07, 0xbb, 0x00, 0x00, 0x66, 0x68, 0x00, 0x02, 0x00, 0x00, 0x66, 28 | 0x68, 0x08, 0x00, 0x00, 0x00, 0x66, 0x53, 0x66, 0x53, 0x66, 0x55, 0x66, 29 | 0x68, 0x00, 0x00, 0x00, 0x00, 0x66, 0x68, 0x00, 0x7c, 0x00, 0x00, 0x66, 30 | 0x61, 0x68, 0x00, 0x00, 0x07, 0xcd, 0x1a, 0x5a, 0x32, 0xf6, 0xea, 0x00, 31 | 0x7c, 0x00, 0x00, 0xcd, 0x18, 0xa0, 0xb7, 0x07, 0xeb, 0x08, 0xa0, 0xb6, 32 | 0x07, 0xeb, 0x03, 0xa0, 0xb5, 0x07, 0x32, 0xe4, 0x05, 0x00, 0x07, 0x8b, 33 | 0xf0, 0xac, 0x3c, 0x00, 0x74, 0x09, 0xbb, 0x07, 0x00, 0xb4, 0x0e, 0xcd, 34 | 0x10, 0xeb, 0xf2, 0xf4, 0xeb, 0xfd, 0x2b, 0xc9, 0xe4, 0x64, 0xeb, 0x00, 35 | 0x24, 0x02, 0xe0, 0xf8, 0x24, 0x02, 0xc3, 0x49, 0x6e, 0x76, 0x61, 0x6c, 36 | 0x69, 0x64, 0x20, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 37 | 0x20, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x00, 0x45, 0x72, 0x72, 0x6f, 0x72, 38 | 0x20, 0x6c, 0x6f, 0x61, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x6f, 0x70, 0x65, 39 | 0x72, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x73, 0x79, 0x73, 0x74, 0x65, 40 | 0x6d, 0x00, 0x4d, 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x20, 0x6f, 0x70, 41 | 0x65, 0x72, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x73, 0x79, 0x73, 0x74, 42 | 0x65, 0x6d, 0x00, 0x00, 0x00, 0x63, 0x7b, 0x9a 43 | }; 44 | /* Next four bytes used for Windows Disk Signature / Drive serial number */ 45 | /* 46 | unsigned char mbr_win7_0x1b8[] = { 47 | 0x00, 0x00, 0x00, 0x00, 48 | 0x00, 0x00 49 | }; 50 | */ 51 | -------------------------------------------------------------------------------- /inc/mbr_2000.h: -------------------------------------------------------------------------------- 1 | /* First 446 bytes of MBR from Windows 2000, XP and 2003 */ 2 | /* This is English version. Bytes 0x12c onwards vary with language. */ 3 | /* Last two bytes 1b6 and 1b7 point to language-specific messages. */ 4 | /* Support of other languages is an exercise for the reader! */ 5 | unsigned char mbr_2000_0x0[] = { 6 | 0x33, 0xc0, 0x8e, 0xd0, 0xbc, 0x00, 0x7c, 0xfb, 0x50, 0x07, 0x50, 0x1f, 7 | 0xfc, 0xbe, 0x1b, 0x7c, 0xbf, 0x1b, 0x06, 0x50, 0x57, 0xb9, 0xe5, 0x01, 8 | 0xf3, 0xa4, 0xcb, 0xbd, 0xbe, 0x07, 0xb1, 0x04, 0x38, 0x6e, 0x00, 0x7c, 9 | 0x09, 0x75, 0x13, 0x83, 0xc5, 0x10, 0xe2, 0xf4, 0xcd, 0x18, 0x8b, 0xf5, 10 | 0x83, 0xc6, 0x10, 0x49, 0x74, 0x19, 0x38, 0x2c, 0x74, 0xf6, 0xa0, 0xb5, 11 | 0x07, 0xb4, 0x07, 0x8b, 0xf0, 0xac, 0x3c, 0x00, 0x74, 0xfc, 0xbb, 0x07, 12 | 0x00, 0xb4, 0x0e, 0xcd, 0x10, 0xeb, 0xf2, 0x88, 0x4e, 0x10, 0xe8, 0x46, 13 | 0x00, 0x73, 0x2a, 0xfe, 0x46, 0x10, 0x80, 0x7e, 0x04, 0x0b, 0x74, 0x0b, 14 | 0x80, 0x7e, 0x04, 0x0c, 0x74, 0x05, 0xa0, 0xb6, 0x07, 0x75, 0xd2, 0x80, 15 | 0x46, 0x02, 0x06, 0x83, 0x46, 0x08, 0x06, 0x83, 0x56, 0x0a, 0x00, 0xe8, 16 | 0x21, 0x00, 0x73, 0x05, 0xa0, 0xb6, 0x07, 0xeb, 0xbc, 0x81, 0x3e, 0xfe, 17 | 0x7d, 0x55, 0xaa, 0x74, 0x0b, 0x80, 0x7e, 0x10, 0x00, 0x74, 0xc8, 0xa0, 18 | 0xb7, 0x07, 0xeb, 0xa9, 0x8b, 0xfc, 0x1e, 0x57, 0x8b, 0xf5, 0xcb, 0xbf, 19 | 0x05, 0x00, 0x8a, 0x56, 0x00, 0xb4, 0x08, 0xcd, 0x13, 0x72, 0x23, 0x8a, 20 | 0xc1, 0x24, 0x3f, 0x98, 0x8a, 0xde, 0x8a, 0xfc, 0x43, 0xf7, 0xe3, 0x8b, 21 | 0xd1, 0x86, 0xd6, 0xb1, 0x06, 0xd2, 0xee, 0x42, 0xf7, 0xe2, 0x39, 0x56, 22 | 0x0a, 0x77, 0x23, 0x72, 0x05, 0x39, 0x46, 0x08, 0x73, 0x1c, 0xb8, 0x01, 23 | 0x02, 0xbb, 0x00, 0x7c, 0x8b, 0x4e, 0x02, 0x8b, 0x56, 0x00, 0xcd, 0x13, 24 | 0x73, 0x51, 0x4f, 0x74, 0x4e, 0x32, 0xe4, 0x8a, 0x56, 0x00, 0xcd, 0x13, 25 | 0xeb, 0xe4, 0x8a, 0x56, 0x00, 0x60, 0xbb, 0xaa, 0x55, 0xb4, 0x41, 0xcd, 26 | 0x13, 0x72, 0x36, 0x81, 0xfb, 0x55, 0xaa, 0x75, 0x30, 0xf6, 0xc1, 0x01, 27 | 0x74, 0x2b, 0x61, 0x60, 0x6a, 0x00, 0x6a, 0x00, 0xff, 0x76, 0x0a, 0xff, 28 | 0x76, 0x08, 0x6a, 0x00, 0x68, 0x00, 0x7c, 0x6a, 0x01, 0x6a, 0x10, 0xb4, 29 | 0x42, 0x8b, 0xf4, 0xcd, 0x13, 0x61, 0x61, 0x73, 0x0e, 0x4f, 0x74, 0x0b, 30 | 0x32, 0xe4, 0x8a, 0x56, 0x00, 0xcd, 0x13, 0xeb, 0xd6, 0x61, 0xf9, 0xc3, 31 | 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x20, 0x70, 0x61, 0x72, 0x74, 32 | 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x00, 33 | 0x45, 0x72, 0x72, 0x6f, 0x72, 0x20, 0x6c, 0x6f, 0x61, 0x64, 0x69, 0x6e, 34 | 0x67, 0x20, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x20, 35 | 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x00, 0x4d, 0x69, 0x73, 0x73, 0x69, 36 | 0x6e, 0x67, 0x20, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6e, 0x67, 37 | 0x20, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x00, 0x00, 0x00, 0x00, 0x00, 38 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 39 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 40 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 41 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 42 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x2c, 0x44, 0x63 43 | }; 44 | /* Next four bytes used for Windows Disk Signature / Drive serial number */ 45 | /* 46 | unsigned char mbr_2000_0x1b8[] = { 47 | 0x00, 0x00, 0x00, 0x00, 48 | 0x00, 0x00 49 | }; 50 | */ 51 | -------------------------------------------------------------------------------- /inc/mbr_95b.h: -------------------------------------------------------------------------------- 1 | /* First 446 bytes of MBR from Windows 95B, 98, 98SE and ME */ 2 | unsigned char mbr_95b_0x0[] = { 3 | 0x33, 0xc0, 0x8e, 0xd0, 0xbc, 0x00, 0x7c, 0xfb, 0x50, 0x07, 0x50, 0x1f, 4 | 0xfc, 0xbe, 0x1b, 0x7c, 0xbf, 0x1b, 0x06, 0x50, 0x57, 0xb9, 0xe5, 0x01, 5 | 0xf3, 0xa4, 0xcb, 0xbe, 0xbe, 0x07, 0xb1, 0x04, 0x38, 0x2c, 0x7c, 0x09, 6 | 0x75, 0x15, 0x83, 0xc6, 0x10, 0xe2, 0xf5, 0xcd, 0x18, 0x8b, 0x14, 0x8b, 7 | 0xee, 0x83, 0xc6, 0x10, 0x49, 0x74, 0x16, 0x38, 0x2c, 0x74, 0xf6, 0xbe, 8 | 0x10, 0x07, 0x4e, 0xac, 0x3c, 0x00, 0x74, 0xfa, 0xbb, 0x07, 0x00, 0xb4, 9 | 0x0e, 0xcd, 0x10, 0xeb, 0xf2, 0x89, 0x46, 0x25, 0x96, 0x8a, 0x46, 0x04, 10 | 0xb4, 0x06, 0x3c, 0x0e, 0x74, 0x11, 0xb4, 0x0b, 0x3c, 0x0c, 0x74, 0x05, 11 | 0x3a, 0xc4, 0x75, 0x2b, 0x40, 0xc6, 0x46, 0x25, 0x06, 0x75, 0x24, 0xbb, 12 | 0xaa, 0x55, 0x50, 0xb4, 0x41, 0xcd, 0x13, 0x58, 0x72, 0x16, 0x81, 0xfb, 13 | 0x55, 0xaa, 0x75, 0x10, 0xf6, 0xc1, 0x01, 0x74, 0x0b, 0x8a, 0xe0, 0x88, 14 | 0x56, 0x24, 0xc7, 0x06, 0xa1, 0x06, 0xeb, 0x1e, 0x88, 0x66, 0x04, 0xbf, 15 | 0x0a, 0x00, 0xb8, 0x01, 0x02, 0x8b, 0xdc, 0x33, 0xc9, 0x83, 0xff, 0x05, 16 | 0x7f, 0x03, 0x8b, 0x4e, 0x25, 0x03, 0x4e, 0x02, 0xcd, 0x13, 0x72, 0x29, 17 | 0xbe, 0x46, 0x07, 0x81, 0x3e, 0xfe, 0x7d, 0x55, 0xaa, 0x74, 0x5a, 0x83, 18 | 0xef, 0x05, 0x7f, 0xda, 0x85, 0xf6, 0x75, 0x83, 0xbe, 0x27, 0x07, 0xeb, 19 | 0x8a, 0x98, 0x91, 0x52, 0x99, 0x03, 0x46, 0x08, 0x13, 0x56, 0x0a, 0xe8, 20 | 0x12, 0x00, 0x5a, 0xeb, 0xd5, 0x4f, 0x74, 0xe4, 0x33, 0xc0, 0xcd, 0x13, 21 | 0xeb, 0xb8 22 | }; 23 | /* Next 6 bytes used to write boot drive and time by some Windows OSs */ 24 | /* 25 | unsigned char mbr_95b_0x0da[] = { 26 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 27 | }; 28 | */ 29 | unsigned char mbr_95b_0x0e0[] = { 30 | 0x56, 0x33, 0xf6, 0x56, 31 | 0x56, 0x52, 0x50, 0x06, 0x53, 0x51, 0xbe, 0x10, 0x00, 0x56, 0x8b, 0xf4, 32 | 0x50, 0x52, 0xb8, 0x00, 0x42, 0x8a, 0x56, 0x24, 0xcd, 0x13, 0x5a, 0x58, 33 | 0x8d, 0x64, 0x10, 0x72, 0x0a, 0x40, 0x75, 0x01, 0x42, 0x80, 0xc7, 0x02, 34 | 0xe2, 0xf7, 0xf8, 0x5e, 0xc3, 0xeb, 0x74, 0x49, 0x6e, 0x76, 0x61, 0x6c, 35 | 0x69, 0x64, 0x20, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 36 | 0x20, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x00, 0x45, 0x72, 0x72, 0x6f, 0x72, 37 | 0x20, 0x6c, 0x6f, 0x61, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x6f, 0x70, 0x65, 38 | 0x72, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x73, 0x79, 0x73, 0x74, 0x65, 39 | 0x6d, 0x00, 0x4d, 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x20, 0x6f, 0x70, 40 | 0x65, 0x72, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x73, 0x79, 0x73, 0x74, 41 | 0x65, 0x6d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 42 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 43 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 44 | 0x00, 0x00, 0x00, 0x8b, 0xfc, 0x1e, 0x57, 0x8b, 0xf5, 0xcb, 0x00, 0x00, 45 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 46 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 47 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 48 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 49 | }; 50 | /* Next four bytes used for Windows Disk Signature / Drive serial number */ 51 | /* 52 | unsigned char mbr_95b_0x1b8[] = { 53 | 0x00, 0x00, 0x00, 0x00, 54 | 0x00, 0x00 55 | }; 56 | */ 57 | -------------------------------------------------------------------------------- /inc/br_fat32_0x3f0.h: -------------------------------------------------------------------------------- 1 | unsigned char br_fat32_0x3f0[] = { 2 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 3 | 0x00, 0x00, 0x55, 0xaa, 0xfa, 0x66, 0x0f, 0xb6, 0x46, 0x10, 0x66, 0x8b, 4 | 0x4e, 0x24, 0x66, 0xf7, 0xe1, 0x66, 0x03, 0x46, 0x1c, 0x66, 0x0f, 0xb7, 5 | 0x56, 0x0e, 0x66, 0x03, 0xc2, 0x33, 0xc9, 0x66, 0x89, 0x46, 0xfc, 0x66, 6 | 0xc7, 0x46, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xfa, 0x66, 0x8b, 0x46, 0x2c, 7 | 0x66, 0x83, 0xf8, 0x02, 0x0f, 0x82, 0xcf, 0xfc, 0x66, 0x3d, 0xf8, 0xff, 8 | 0xff, 0x0f, 0x0f, 0x83, 0xc5, 0xfc, 0x66, 0x0f, 0xa4, 0xc2, 0x10, 0xfb, 9 | 0x52, 0x50, 0xfa, 0x66, 0xc1, 0xe0, 0x10, 0x66, 0x0f, 0xac, 0xd0, 0x10, 10 | 0x66, 0x83, 0xe8, 0x02, 0x66, 0x0f, 0xb6, 0x5e, 0x0d, 0x8b, 0xf3, 0x66, 11 | 0xf7, 0xe3, 0x66, 0x03, 0x46, 0xfc, 0x66, 0x0f, 0xa4, 0xc2, 0x10, 0xfb, 12 | 0xbb, 0x00, 0x07, 0x8b, 0xfb, 0xb9, 0x01, 0x00, 0xe8, 0xbe, 0xfc, 0x0f, 13 | 0x82, 0xaa, 0xfc, 0x38, 0x2d, 0x74, 0x1e, 0xb1, 0x0b, 0x56, 0xbe, 0xd8, 14 | 0x7d, 0xf3, 0xa6, 0x5e, 0x74, 0x19, 0x03, 0xf9, 0x83, 0xc7, 0x15, 0x3b, 15 | 0xfb, 0x72, 0xe8, 0x4e, 0x75, 0xd6, 0x58, 0x5a, 0xe8, 0x66, 0x00, 0x72, 16 | 0xab, 0x83, 0xc4, 0x04, 0xe9, 0x64, 0xfc, 0x83, 0xc4, 0x04, 0x8b, 0x75, 17 | 0x09, 0x8b, 0x7d, 0x0f, 0x8b, 0xc6, 0xfa, 0x66, 0xc1, 0xe0, 0x10, 0x8b, 18 | 0xc7, 0x66, 0x83, 0xf8, 0x02, 0x72, 0x3b, 0x66, 0x3d, 0xf8, 0xff, 0xff, 19 | 0x0f, 0x73, 0x33, 0x66, 0x48, 0x66, 0x48, 0x66, 0x0f, 0xb6, 0x4e, 0x0d, 20 | 0x66, 0xf7, 0xe1, 0x66, 0x03, 0x46, 0xfc, 0x66, 0x0f, 0xa4, 0xc2, 0x10, 21 | 0xfb, 0xbb, 0x00, 0x07, 0x53, 0xb9, 0x04, 0x00, 0xe8, 0x52, 0xfc, 0x5b, 22 | 0x0f, 0x82, 0x3d, 0xfc, 0x81, 0x3f, 0x4d, 0x5a, 0x75, 0x08, 0x81, 0xbf, 23 | 0x00, 0x02, 0x42, 0x4a, 0x74, 0x06, 0xbe, 0x80, 0x7d, 0xe9, 0x0e, 0xfc, 24 | 0xea, 0x00, 0x02, 0x70, 0x00, 0x03, 0xc0, 0x13, 0xd2, 0x03, 0xc0, 0x13, 25 | 0xd2, 0xe8, 0x18, 0x00, 0xfa, 0x26, 0x66, 0x8b, 0x01, 0x66, 0x25, 0xff, 26 | 0xff, 0xff, 0x0f, 0x66, 0x0f, 0xa4, 0xc2, 0x10, 0x66, 0x3d, 0xf8, 0xff, 27 | 0xff, 0x0f, 0xfb, 0xc3, 0xbf, 0x00, 0x7e, 0xfa, 0x66, 0xc1, 0xe0, 0x10, 28 | 0x66, 0x0f, 0xac, 0xd0, 0x10, 0x66, 0x0f, 0xb7, 0x4e, 0x0b, 0x66, 0x33, 29 | 0xd2, 0x66, 0xf7, 0xf1, 0x66, 0x3b, 0x46, 0xf8, 0x74, 0x44, 0x66, 0x89, 30 | 0x46, 0xf8, 0x66, 0x03, 0x46, 0x1c, 0x66, 0x0f, 0xb7, 0x4e, 0x0e, 0x66, 31 | 0x03, 0xc1, 0x66, 0x0f, 0xb7, 0x5e, 0x28, 0x83, 0xe3, 0x0f, 0x74, 0x16, 32 | 0x3a, 0x5e, 0x10, 0x0f, 0x83, 0xa4, 0xfb, 0x52, 0x66, 0x8b, 0xc8, 0x66, 33 | 0x8b, 0x46, 0x24, 0x66, 0xf7, 0xe3, 0x66, 0x03, 0xc1, 0x5a, 0x52, 0x66, 34 | 0x0f, 0xa4, 0xc2, 0x10, 0xfb, 0x8b, 0xdf, 0xb9, 0x01, 0x00, 0xe8, 0xb4, 35 | 0xfb, 0x5a, 0x0f, 0x82, 0x9f, 0xfb, 0xfb, 0x8b, 0xda, 0xc3, 0x00, 0x00, 36 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 37 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 38 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 39 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 40 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 41 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 42 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 43 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 44 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 45 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0xaa 46 | }; 47 | -------------------------------------------------------------------------------- /inc/br_fat32nt_0x3f0.h: -------------------------------------------------------------------------------- 1 | unsigned char br_fat32nt_0x3f0[] = { 2 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 3 | 0x00, 0x00, 0x55, 0xaa, 0xfa, 0x66, 0x0f, 0xb6, 0x46, 0x10, 0x66, 0x8b, 4 | 0x4e, 0x24, 0x66, 0xf7, 0xe1, 0x66, 0x03, 0x46, 0x1c, 0x66, 0x0f, 0xb7, 5 | 0x56, 0x0e, 0x66, 0x03, 0xc2, 0x33, 0xc9, 0x66, 0x89, 0x46, 0xfc, 0x66, 6 | 0xc7, 0x46, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xfa, 0x66, 0x8b, 0x46, 0x2c, 7 | 0x66, 0x83, 0xf8, 0x02, 0x0f, 0x82, 0xcf, 0xfc, 0x66, 0x3d, 0xf8, 0xff, 8 | 0xff, 0x0f, 0x0f, 0x83, 0xc5, 0xfc, 0x66, 0x0f, 0xa4, 0xc2, 0x10, 0xfb, 9 | 0x52, 0x50, 0xfa, 0x66, 0xc1, 0xe0, 0x10, 0x66, 0x0f, 0xac, 0xd0, 0x10, 10 | 0x66, 0x83, 0xe8, 0x02, 0x66, 0x0f, 0xb6, 0x5e, 0x0d, 0x8b, 0xf3, 0x66, 11 | 0xf7, 0xe3, 0x66, 0x03, 0x46, 0xfc, 0x66, 0x0f, 0xa4, 0xc2, 0x10, 0xfb, 12 | 0xbb, 0x00, 0x07, 0x8b, 0xfb, 0xb9, 0x01, 0x00, 0xe8, 0xbe, 0xfc, 0x0f, 13 | 0x82, 0xaa, 0xfc, 0x38, 0x2d, 0x74, 0x1e, 0xb1, 0x0b, 0x56, 0xbe, 0xd8, 14 | 0x7d, 0xf3, 0xa6, 0x5e, 0x74, 0x19, 0x03, 0xf9, 0x83, 0xc7, 0x15, 0x3b, 15 | 0xfb, 0x72, 0xe8, 0x4e, 0x75, 0xd6, 0x58, 0x5a, 0xe8, 0x66, 0x00, 0x72, 16 | 0xab, 0x83, 0xc4, 0x04, 0xe9, 0x64, 0xfc, 0x83, 0xc4, 0x04, 0x8b, 0x75, 17 | 0x09, 0x8b, 0x7d, 0x0f, 0x8b, 0xc6, 0xfa, 0x66, 0xc1, 0xe0, 0x10, 0x8b, 18 | 0xc7, 0x66, 0x83, 0xf8, 0x02, 0x72, 0x3b, 0x66, 0x3d, 0xf8, 0xff, 0xff, 19 | 0x0f, 0x73, 0x33, 0x66, 0x48, 0x66, 0x48, 0x66, 0x0f, 0xb6, 0x4e, 0x0d, 20 | 0x66, 0xf7, 0xe1, 0x66, 0x03, 0x46, 0xfc, 0x66, 0x0f, 0xa4, 0xc2, 0x10, 21 | 0xfb, 0xbb, 0x00, 0x07, 0x53, 0xb9, 0x04, 0x00, 0xe8, 0x52, 0xfc, 0x5b, 22 | 0x0f, 0x82, 0x3d, 0xfc, 0x81, 0x3f, 0x4d, 0x5a, 0x75, 0x08, 0x81, 0xbf, 23 | 0x00, 0x02, 0x42, 0x4a, 0x74, 0x06, 0xbe, 0x80, 0x7d, 0xe9, 0x0e, 0xfc, 24 | 0xea, 0x00, 0x02, 0x70, 0x00, 0x03, 0xc0, 0x13, 0xd2, 0x03, 0xc0, 0x13, 25 | 0xd2, 0xe8, 0x18, 0x00, 0xfa, 0x26, 0x66, 0x8b, 0x01, 0x66, 0x25, 0xff, 26 | 0xff, 0xff, 0x0f, 0x66, 0x0f, 0xa4, 0xc2, 0x10, 0x66, 0x3d, 0xf8, 0xff, 27 | 0xff, 0x0f, 0xfb, 0xc3, 0xbf, 0x00, 0x7e, 0xfa, 0x66, 0xc1, 0xe0, 0x10, 28 | 0x66, 0x0f, 0xac, 0xd0, 0x10, 0x66, 0x0f, 0xb7, 0x4e, 0x0b, 0x66, 0x33, 29 | 0xd2, 0x66, 0xf7, 0xf1, 0x66, 0x3b, 0x46, 0xf8, 0x74, 0x44, 0x66, 0x89, 30 | 0x46, 0xf8, 0x66, 0x03, 0x46, 0x1c, 0x66, 0x0f, 0xb7, 0x4e, 0x0e, 0x66, 31 | 0x03, 0xc1, 0x66, 0x0f, 0xb7, 0x5e, 0x28, 0x83, 0xe3, 0x0f, 0x74, 0x16, 32 | 0x3a, 0x5e, 0x10, 0x0f, 0x83, 0xa4, 0xfb, 0x52, 0x66, 0x8b, 0xc8, 0x66, 33 | 0x8b, 0x46, 0x24, 0x66, 0xf7, 0xe3, 0x66, 0x03, 0xc1, 0x5a, 0x52, 0x66, 34 | 0x0f, 0xa4, 0xc2, 0x10, 0xfb, 0x8b, 0xdf, 0xb9, 0x01, 0x00, 0xe8, 0xb4, 35 | 0xfb, 0x5a, 0x0f, 0x82, 0x9f, 0xfb, 0xfb, 0x8b, 0xda, 0xc3, 0x00, 0x00, 36 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 37 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 38 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 39 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 40 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 41 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 42 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 43 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 44 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 45 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0xaa 46 | }; 47 | -------------------------------------------------------------------------------- /inc/br_fat32pe_0x3f0.h: -------------------------------------------------------------------------------- 1 | unsigned char br_fat32pe_0x3f0[] = { 2 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 3 | 0x00, 0x00, 0x55, 0xaa, 0xfa, 0x66, 0x0f, 0xb6, 0x46, 0x10, 0x66, 0x8b, 4 | 0x4e, 0x24, 0x66, 0xf7, 0xe1, 0x66, 0x03, 0x46, 0x1c, 0x66, 0x0f, 0xb7, 5 | 0x56, 0x0e, 0x66, 0x03, 0xc2, 0x33, 0xc9, 0x66, 0x89, 0x46, 0xfc, 0x66, 6 | 0xc7, 0x46, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xfa, 0x66, 0x8b, 0x46, 0x2c, 7 | 0x66, 0x83, 0xf8, 0x02, 0x0f, 0x82, 0xcf, 0xfc, 0x66, 0x3d, 0xf8, 0xff, 8 | 0xff, 0x0f, 0x0f, 0x83, 0xc5, 0xfc, 0x66, 0x0f, 0xa4, 0xc2, 0x10, 0xfb, 9 | 0x52, 0x50, 0xfa, 0x66, 0xc1, 0xe0, 0x10, 0x66, 0x0f, 0xac, 0xd0, 0x10, 10 | 0x66, 0x83, 0xe8, 0x02, 0x66, 0x0f, 0xb6, 0x5e, 0x0d, 0x8b, 0xf3, 0x66, 11 | 0xf7, 0xe3, 0x66, 0x03, 0x46, 0xfc, 0x66, 0x0f, 0xa4, 0xc2, 0x10, 0xfb, 12 | 0xbb, 0x00, 0x07, 0x8b, 0xfb, 0xb9, 0x01, 0x00, 0xe8, 0xbe, 0xfc, 0x0f, 13 | 0x82, 0xaa, 0xfc, 0x38, 0x2d, 0x74, 0x1e, 0xb1, 0x0b, 0x56, 0xbe, 0xd8, 14 | 0x7d, 0xf3, 0xa6, 0x5e, 0x74, 0x19, 0x03, 0xf9, 0x83, 0xc7, 0x15, 0x3b, 15 | 0xfb, 0x72, 0xe8, 0x4e, 0x75, 0xd6, 0x58, 0x5a, 0xe8, 0x66, 0x00, 0x72, 16 | 0xab, 0x83, 0xc4, 0x04, 0xe9, 0x64, 0xfc, 0x83, 0xc4, 0x04, 0x8b, 0x75, 17 | 0x09, 0x8b, 0x7d, 0x0f, 0x8b, 0xc6, 0xfa, 0x66, 0xc1, 0xe0, 0x10, 0x8b, 18 | 0xc7, 0x66, 0x83, 0xf8, 0x02, 0x72, 0x3b, 0x66, 0x3d, 0xf8, 0xff, 0xff, 19 | 0x0f, 0x73, 0x33, 0x66, 0x48, 0x66, 0x48, 0x66, 0x0f, 0xb6, 0x4e, 0x0d, 20 | 0x66, 0xf7, 0xe1, 0x66, 0x03, 0x46, 0xfc, 0x66, 0x0f, 0xa4, 0xc2, 0x10, 21 | 0xfb, 0xbb, 0x00, 0x07, 0x53, 0xb9, 0x04, 0x00, 0xe8, 0x52, 0xfc, 0x5b, 22 | 0x0f, 0x82, 0x3d, 0xfc, 0x81, 0x3f, 0x4d, 0x5a, 0x75, 0x08, 0x81, 0xbf, 23 | 0x00, 0x02, 0x42, 0x4a, 0x74, 0x06, 0xbe, 0x80, 0x7d, 0xe9, 0x0e, 0xfc, 24 | 0xea, 0x00, 0x02, 0x70, 0x00, 0x03, 0xc0, 0x13, 0xd2, 0x03, 0xc0, 0x13, 25 | 0xd2, 0xe8, 0x18, 0x00, 0xfa, 0x26, 0x66, 0x8b, 0x01, 0x66, 0x25, 0xff, 26 | 0xff, 0xff, 0x0f, 0x66, 0x0f, 0xa4, 0xc2, 0x10, 0x66, 0x3d, 0xf8, 0xff, 27 | 0xff, 0x0f, 0xfb, 0xc3, 0xbf, 0x00, 0x7e, 0xfa, 0x66, 0xc1, 0xe0, 0x10, 28 | 0x66, 0x0f, 0xac, 0xd0, 0x10, 0x66, 0x0f, 0xb7, 0x4e, 0x0b, 0x66, 0x33, 29 | 0xd2, 0x66, 0xf7, 0xf1, 0x66, 0x3b, 0x46, 0xf8, 0x74, 0x44, 0x66, 0x89, 30 | 0x46, 0xf8, 0x66, 0x03, 0x46, 0x1c, 0x66, 0x0f, 0xb7, 0x4e, 0x0e, 0x66, 31 | 0x03, 0xc1, 0x66, 0x0f, 0xb7, 0x5e, 0x28, 0x83, 0xe3, 0x0f, 0x74, 0x16, 32 | 0x3a, 0x5e, 0x10, 0x0f, 0x83, 0xa4, 0xfb, 0x52, 0x66, 0x8b, 0xc8, 0x66, 33 | 0x8b, 0x46, 0x24, 0x66, 0xf7, 0xe3, 0x66, 0x03, 0xc1, 0x5a, 0x52, 0x66, 34 | 0x0f, 0xa4, 0xc2, 0x10, 0xfb, 0x8b, 0xdf, 0xb9, 0x01, 0x00, 0xe8, 0xb4, 35 | 0xfb, 0x5a, 0x0f, 0x82, 0x9f, 0xfb, 0xfb, 0x8b, 0xda, 0xc3, 0x00, 0x00, 36 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 37 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 38 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 39 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 40 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 41 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 42 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 43 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 44 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 45 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0xaa 46 | }; 47 | -------------------------------------------------------------------------------- /inc/br_fat32fd_0x3f0.h: -------------------------------------------------------------------------------- 1 | /* br_fat32_0x52.h 2 | // 3 | // ANI 4 | // substring gmbh/tw 14.9.04 5 | // modified cluster code 0x3f0 to support FreeDOS 6 | */ 7 | unsigned char br_fat32_0x3f0[] = { 8 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 9 | 0x00, 0x00, 0x55, 0xaa, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 10 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 11 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 12 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 13 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 14 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 15 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 16 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 17 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 18 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 19 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 20 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 21 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 22 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 23 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 24 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 25 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 26 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 27 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 28 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 29 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 30 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 31 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 32 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 33 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 34 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 35 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 36 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 37 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 38 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 39 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 40 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 41 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 42 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 43 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 44 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 45 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 46 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 47 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 48 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 49 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 50 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 51 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0xaa 52 | }; 53 | 54 | -------------------------------------------------------------------------------- /src/file.c: -------------------------------------------------------------------------------- 1 | /****************************************************************** 2 | Copyright (C) 2009 Henrik Carlqvist 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation; either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 17 | ******************************************************************/ 18 | #include 19 | #include 20 | 21 | #include "nls.h" 22 | #include "file.h" 23 | 24 | #include 25 | #if defined(__FreeBSD__) || defined(__OpenBSD__) 26 | #include 27 | #endif 28 | 29 | int contains_data(FILE *fp, unsigned long ulPosition, 30 | const void *pData, unsigned int uiLen) 31 | { 32 | unsigned char aucBuf[MAX_DATA_LEN]; 33 | 34 | if(!read_data(fp, ulPosition, aucBuf, uiLen)) 35 | return 0; 36 | if(memcmp(pData, aucBuf, uiLen)) 37 | return 0; 38 | return 1; 39 | } /* contains_data */ 40 | 41 | int read_data(FILE *fp, unsigned long ulPosition, 42 | void *pData, unsigned int uiLen) 43 | { 44 | unsigned char aucBuf[MAX_DATA_LEN]; 45 | 46 | unsigned long start_read = ulPosition; 47 | unsigned long to_read = uiLen; 48 | 49 | #if defined(__FreeBSD__) || defined(__OpenBSD__) 50 | /* cannot read/write directly from/to disk at random offsets */ 51 | /* must read/write from/to pagesize boundaries */ 52 | 53 | /*Rounding functions for multiples that are powers of two:*/ 54 | /*Up: return ((number + multiple - 1) & ~(multiple - 1));*/ 55 | /*Down: return (number & ~(multiple - 1));*/ 56 | 57 | unsigned long pagesize = sysconf(_SC_PAGE_SIZE); 58 | start_read = ulPosition & ~(pagesize - 1); /* round down */ 59 | to_read = (((ulPosition + uiLen) + pagesize - 1) & ~(pagesize - 1)) - start_read; /* round up */ 60 | #endif 61 | 62 | if(to_read > MAX_DATA_LEN) 63 | { 64 | fprintf(stderr, _("Error: contains_data called with uiLen > %d,\n"), 65 | MAX_DATA_LEN); 66 | fprintf(stderr, _("please increase MAX_DATA_LEN in file.h\n")); 67 | return 0; 68 | } 69 | 70 | if(fseek(fp, start_read, SEEK_SET)) 71 | return 0; 72 | if(!fread(aucBuf, to_read, 1, fp)) 73 | return 0; 74 | memcpy(pData, aucBuf + ulPosition - start_read, uiLen); 75 | return 1; 76 | } /* read_data */ 77 | 78 | int write_data(FILE *fp, unsigned long ulPosition, 79 | const void *pData, unsigned int uiLen) 80 | { 81 | unsigned long start_write = ulPosition; 82 | unsigned long to_write = uiLen; 83 | 84 | #if defined (__FreeBSD__) || defined(__OpenBSD__) 85 | /* cannot read/write directly from/to disk at random offsets */ 86 | /* must read/write from/to pagesize boundaries */ 87 | unsigned long pagesize = sysconf(_SC_PAGE_SIZE); 88 | unsigned char aucBuf[MAX_DATA_LEN]; 89 | 90 | start_write = ulPosition & ~(pagesize - 1); /* round down */ 91 | to_write = (((ulPosition + uiLen) + pagesize - 1) & ~(pagesize - 1)) - start_write; /* round up */ 92 | 93 | if(fseek(fp, start_write, SEEK_SET)) 94 | return 0; 95 | if(!fread(aucBuf, to_write, 1, fp)) 96 | return 0; 97 | 98 | /* modify in the local buffer first */ 99 | memcpy(aucBuf + ulPosition - start_write, pData, uiLen); 100 | pData = aucBuf; 101 | #endif 102 | 103 | if(fseek(fp, start_write, SEEK_SET)) 104 | return 0; 105 | if(!fwrite(pData, to_write, 1, fp)) 106 | return 0; 107 | return 1; 108 | } /* write_data */ 109 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | 1. General 2 | ---------- 3 | 4 | This program is used to create Microsoft compatible boot records. It is able 5 | to do the same as Microsoft "fdisk /mbr" to a hard disk. It is also able to 6 | do the same as Microsoft "sys d:" to a floppy or FAT partition except that 7 | it does not copy any system files, only the boot record is written. 8 | Specifications of boot records is taken from 9 | http://www.geocities.com/thestarman3/asm/mbr/MBR_in_detail.htm 10 | 11 | The program is useful when using Linux to restore a backup of a reference 12 | Microsoft Windows installation. 13 | 14 | Author of this program is Henrik Carlqvist (henca@users.SourceForge.net), it 15 | is available for download from http://ms-sys.sourceforge.net/ 16 | 17 | 2. Installation 18 | --------------- 19 | 20 | Step 1, unpack the archive: 21 | 22 | tar -xzvf ms-sys*.tgz 23 | 24 | Step 2, compile: 25 | 26 | cd ms-sys 27 | make 28 | 29 | Step 3, become root and install 30 | 31 | su (and give password) 32 | make install 33 | 34 | 3. Examples 35 | ----------- 36 | 37 | Please note that Windows ME is not useful for making standalone bootable 38 | floppies. However, Win9x and DOS works fine with example 1 and example 3. 39 | 40 | Example 1, creating a 1.68 MB bootable floppy: 41 | This example assumes that you have your windows installation mounted at /dosc 42 | and also have mtools and fdformat installed. 43 | 44 | fdformat /dev/fd0u1680 45 | mformat a: 46 | ms-sys -w /dev/fd0 47 | mcopy /dosc/io.sys a: 48 | mcopy /dosc/msdos.sys a: 49 | mcopy /dosc/command.com a: 50 | 51 | 52 | Example 2, restoring a backup to a fresh hard disk: 53 | 54 | Step 1, use GNU parted to create your FAT32 partition and file system: 55 | 56 | parted (then create partition and file system) 57 | 58 | Step 2, write the MBR: 59 | 60 | ms-sys -w /dev/hda 61 | 62 | Step 3, write the FAT32 partition boot record: 63 | 64 | ms-sys -w /dev/hda1 65 | 66 | Step 3b, write partition info and drive id to partition: 67 | 68 | ms-sys -p /dev/hda1 69 | 70 | This step might be needed depending on which program was used to format the 71 | partition. If the program was formatted with gnu parted this step could be 72 | skipped. It is also possible to combine this flag with the previous step 73 | like this: ms-sys -wp /dev/hda1 74 | 75 | Step 4, mount your new filesystem: 76 | 77 | mount /dev/hda1 /mnt 78 | 79 | Step 5, read your backup 80 | 81 | cd /mnt; tar -xzvf /path/to/my_windows_backup_file.tgz 82 | 83 | 84 | Example 3, creating a bootable 2.8 MB floppy image for use with an el-torito 85 | bootable CD: 86 | 87 | dd if=/dev/zero of=floppy288.img bs=1024 count=2880 88 | /sbin/mkdosfs floppy288.img 89 | ms-sys -1 -f floppy288.img 90 | su 91 | mount -o loop floppy288.img /mnt 92 | cp msdos.sys /mnt/ 93 | cp io.sys /mnt/ 94 | cp command.com /mnt/ 95 | (it might also be a good idea to add a config.sys and autoexec.bat with 96 | CDROM support) 97 | umount /mnt 98 | exit 99 | cp floppy288.img cd-files/eltorito.img 100 | mkisofs -b eltorito.img -c eltorito.cat -o cdimage.iso cd-files 101 | (burn the file cdimage.iso to a CD with cdrecord or another program) 102 | 103 | 4. Documentation 104 | ---------------- 105 | 106 | There is a man-page for ms-sys, and you will get some help by typing: 107 | 108 | ms-sys --help 109 | 110 | 5. Known problems 111 | ----------------- 112 | 113 | There have been reports about unbootable FAT32 partitions created with 114 | "mformat -F c:". One workaround is to use gnu parted to create the 115 | partition instead. Since version 1.1.3 ms-sys has the switch -p which 116 | is supposed to fix this problem. The problem has also been reported on 117 | partitions formatted with mkdosfs and mkfs.vfat. 118 | 119 | There have been yet another problem reported about the -p switch and gnu 120 | parted together with Linux kernel 2.6. The problem is that kernel 2.6 might 121 | report a geometry incompatible with other operating systems. There is a 122 | detailed description of the problem at 123 | http://groups-beta.google.com/group/linux.kernel/msg/404d8683ce302cf2 124 | As a workaround for this ms-sys now has the switch -H to manually set the 125 | number of heads. The next problem is to find out what value for number of 126 | heads to give. If the system was booted by LILO this can be shown by 127 | "lilo -T geom". 128 | 129 | There have been reports about problems when compiling against uClibc. More 130 | problem reports or suggestions of fixes are welcome! 131 | 132 | Writing Windows 7 NTFS boot records with ms-sys is probably not useful if 133 | the intention is to get a bootable partition. 134 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # Generic GNU Makefile with Native Language Support 2 | # written by Henrik Carlqvist 3 | # 4 | # Possible targets are: 5 | # make normal compile 6 | # make all normal compile, the same as above 7 | # make install installs compiled files 8 | # make uninstall removes installed files 9 | # make clean removes compiled files 10 | # make mrproper removes compiled files and dependencies 11 | # make debug compiles with flag -g for debuggers 12 | # make messages creates po/messages.po as a skeleton for NLS 13 | # 14 | # Contributors: Henrik Carlqvist 15 | # Alon Bar-Lev 16 | 17 | # Name of program, compiled executable file 18 | PACKAGE = ms-sys 19 | 20 | # Add anything extra you might need when comipiling below 21 | # Example: EXTRA_CFLAGS = -D MY_DEFINE=1 22 | 23 | # The row below is a workaround for systems which lack libintl.h 24 | EXTRA_CFLAGS = -idirafter include-fallback -D_FILE_OFFSET_BITS=64 25 | 26 | # Add anything extra you might need when linking below 27 | # Example: EXTRA_LDFLAGS = -lm 28 | EXTRA_LDFLAGS = 29 | 30 | # Paths 31 | 32 | # Installation path 33 | PREFIX ?= /usr/local 34 | BINDIR = $(PREFIX)/bin 35 | LOCALEDIR = $(PREFIX)/share/locale 36 | MANDIR = $(PREFIX)/man 37 | 38 | # Where your .c-files live 39 | SRC = src 40 | # Where your .h-files live 41 | INC = inc 42 | # Where .d-files will be created for dependencies 43 | DEP = dep 44 | # Where any .po-files live for native language support, eg sv_SE.po or de_DE.po 45 | # A skeleton .po-file could be created by "make messages" 46 | PO = po 47 | # Where your man-pages live 48 | MAN = man 49 | # Where .mo-files will be created 50 | MO = mo 51 | # Where .o-files will be created 52 | OBJ = obj 53 | # Where your program will be created before installation 54 | BIN = bin 55 | 56 | # There is no need to change anything below this line 57 | #*********************************************************************** 58 | 59 | # Used for Native Language Support, do not change! 60 | MESSDIR = LC_MESSAGES 61 | 62 | INCDIRS = $(INC) 63 | 64 | CC ?= gcc 65 | INCLUDES = $(INCDIRS:%=-I %) 66 | CFLAGS ?= -O2 67 | ifeq ($(MAKECMDGOALS),debug) 68 | CFLAGS ?= -g 69 | endif 70 | CFLAGS += -ansi -pedantic -Wall -c $(INCLUDES) \ 71 | -D PACKAGE=\"$(PACKAGE)\" -D LOCALEDIR=\"$(LOCALEDIR)\" \ 72 | $(EXTRA_CFLAGS) 73 | LDFLAGS += $(EXTRA_LDFLAGS) 74 | 75 | 76 | SRC_FILES = $(wildcard $(SRC)/*.c) 77 | INC_FILES = $(wildcard $(INC)/*.h) 78 | 79 | MESSAGES = $(PO)/messages.po 80 | 81 | MAN_SRC = $(wildcard $(MAN)/*.* $(MAN)/??/*.*) 82 | 83 | PO_FILES = $(filter-out $(MESSAGES),$(wildcard $(PO)/*.po)) 84 | MO_FILES = $(PO_FILES:$(PO)/%.po=$(MO)/%.mo) 85 | LANGUAGES ?= $(PO_FILES:$(PO)/%.po=%) 86 | NLS_FILES = $(LANGUAGES:%=$(DESTDIR)$(LOCALEDIR)/%/$(MESSDIR)/$(PACKAGE).mo) 87 | MAN_FILES = $(foreach FILE, $(MAN_SRC), \ 88 | $(DESTDIR)$(subst $(MAN),$(MANDIR),$(dir $(FILE)))man$(subst .,,$(suffix $(FILE)))/$(notdir $(FILE))) 89 | 90 | FILES = $(SRC_FILES:$(SRC)/%.c=%) 91 | 92 | OBJS = $(FILES:%=$(OBJ)/%.o) 93 | DEPS = $(FILES:%=$(DEP)/%.d) 94 | 95 | all debug: $(BIN)/$(PACKAGE) $(MO_FILES) 96 | 97 | install: $(DESTDIR)$(BINDIR)/$(PACKAGE) $(NLS_FILES) $(MAN_FILES) 98 | 99 | uninstall: 100 | $(RM) $(DESTDIR)$(BINDIR)/$(PACKAGE) $(NLS_FILES) $(MAN_FILES) 101 | 102 | messages: $(MESSAGES) 103 | 104 | mrproper: clean 105 | $(RM) $(DEP)/*.d 106 | $(RM) $(OS_CHECK) 107 | 108 | clean: 109 | $(RM) $(MESSAGES) 110 | $(RM) $(MO)/*.mo 111 | $(RM) $(OBJ)/*.o 112 | $(RM) $(LIB)/*.a 113 | $(RM) $(filter-out $(BIN)/CVS,$(wildcard $(BIN)/*)) 114 | 115 | $(DESTDIR)$(BINDIR)/%: $(BIN)/% 116 | install -D -m 755 $^ $@ 117 | 118 | $(DESTDIR)$(LOCALEDIR)/%/$(MESSDIR)/$(PACKAGE).mo: $(MO)/%.mo 119 | mkdir -p $(DESTDIR)$(LOCALEDIR)/$*/$(MESSDIR) 120 | install -D -m 644 $^ $@ 121 | 122 | $(DESTDIR)$(MANDIR)/%: $(MAN)/$(dir $(*D))/$(*F) 123 | install -D -m 644 $(MAN)/$(dir $(*D))$(*F) $@ 124 | gzip -f $@ 125 | 126 | #$(DESTDIR)$(MANDIR)/%: $(MAN)/$(*F) 127 | # echo t: $< 128 | # install -D -m 644 $(MAN)/$(*F) $@ 129 | 130 | $(BIN)/%: $(OBJS) 131 | $(CC) -o $@ $^ $(LDFLAGS) 132 | 133 | $(MESSAGES): $(SRC_FILES) $(INC_FILES) 134 | xgettext -k_ -o$@ $^ 135 | 136 | $(OBJS): $(OBJ)/%.o: $(SRC)/%.c $(DEP)/%.d \ 137 | $(filter-out $(wildcard $(OBJ)), $(OBJ)) \ 138 | $(filter-out $(wildcard $(BIN)), $(BIN)) 139 | $(CC) $(CFLAGS) -o $@ $< 140 | 141 | $(MO_FILES): $(MO)/%.mo: $(PO)/%.po $(filter-out $(wildcard $(MO)), $(MO)) 142 | msgfmt -o $@ $< 143 | 144 | $(DEPS): $(DEP)/%.d: $(SRC)/%.c $(filter-out $(wildcard $(DEP)), $(DEP)) 145 | ifeq ($(MAKECMDGOALS),quiet) 146 | @$(CC) -MM $(CFLAGS) -MT $@ $< > $@ 147 | else 148 | $(CC) -MM $(CFLAGS) -MT $@ $< > $@ 149 | endif 150 | 151 | ifneq ($(MAKECMDGOALS),mrproper) 152 | ifneq ($(wildcard $(DEPS)),) 153 | include $(wildcard $(DEPS)) 154 | endif 155 | endif 156 | 157 | # Create directories which might be lost from CVS 158 | $(DEP) $(OBJ) $(BIN) $(MO): 159 | mkdir -p $@ 160 | 161 | # Used to force some rules to always be compiled 162 | FORCE: ; 163 | 164 | 165 | -------------------------------------------------------------------------------- /src/fat16.c: -------------------------------------------------------------------------------- 1 | /****************************************************************** 2 | Copyright (C) 2009 Henrik Carlqvist 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation; either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 17 | ******************************************************************/ 18 | #include 19 | #include 20 | 21 | #include "file.h" 22 | #include "fat16.h" 23 | 24 | int is_fat_16_fs(FILE *fp) 25 | { 26 | char *szMagic = "FAT16 "; 27 | 28 | return contains_data(fp, 0x36, szMagic, strlen(szMagic)); 29 | } /* is_fat_16_fs */ 30 | 31 | int is_fat_16_br(FILE *fp) 32 | { 33 | /* A "file" is probably some kind of FAT16 boot record if it contains the 34 | magic chars 0x55, 0xAA at positions 0x1FE */ 35 | unsigned char aucRef[] = {0x55, 0xAA}; 36 | unsigned char aucMagic[] = {'M','S','W','I','N','4','.','1'}; 37 | 38 | if( ! contains_data(fp, 0x1FE, aucRef, sizeof(aucRef))) 39 | return 0; 40 | if( ! contains_data(fp, 0x03, aucMagic, sizeof(aucMagic))) 41 | return 0; 42 | return 1; 43 | } /* is_fat_16_br */ 44 | 45 | int entire_fat_16_br_matches(FILE *fp) 46 | { 47 | #include "br_fat16_0x0.h" 48 | #include "br_fat16_0x3e.h" 49 | 50 | return 51 | ( contains_data(fp, 0x0, br_fat16_0x0, sizeof(br_fat16_0x0)) && 52 | /* BIOS Parameter Block might differ between systems */ 53 | contains_data(fp, 0x3e, br_fat16_0x3e, sizeof(br_fat16_0x3e)) ); 54 | } /* entire_fat_16_br_matches */ 55 | 56 | int write_fat_16_br(FILE *fp, int bKeepLabel) 57 | { 58 | #include "label_11_char.h" 59 | #include "br_fat16_0x0.h" 60 | #include "br_fat16_0x3e.h" 61 | 62 | if(bKeepLabel) 63 | return 64 | ( write_data(fp, 0x0, br_fat16_0x0, sizeof(br_fat16_0x0)) && 65 | /* BIOS Parameter Block should not be overwritten */ 66 | write_data(fp, 0x3e, br_fat16_0x3e, sizeof(br_fat16_0x3e)) ); 67 | else 68 | return 69 | ( write_data(fp, 0x0, br_fat16_0x0, sizeof(br_fat16_0x0)) && 70 | /* BIOS Parameter Block should not be overwritten */ 71 | write_data(fp, 0x2b, label_11_char, sizeof(label_11_char)) && 72 | write_data(fp, 0x3e, br_fat16_0x3e, sizeof(br_fat16_0x3e)) ); 73 | } /* write_fat_16_br */ 74 | 75 | int entire_fat_16_fd_br_matches(FILE *fp) 76 | { 77 | #include "br_fat16_0x0.h" 78 | #include "br_fat16fd_0x3e.h" 79 | 80 | return 81 | ( contains_data(fp, 0x0, br_fat16_0x0, sizeof(br_fat16_0x0)) && 82 | /* BIOS Parameter Block might differ between systems */ 83 | contains_data(fp, 0x3e, br_fat16_0x3e, sizeof(br_fat16_0x3e)) ); 84 | } /* entire_fat_16_fd_br_matches */ 85 | 86 | int write_fat_16_fd_br(FILE *fp, int bKeepLabel) 87 | { 88 | #include "label_11_char.h" 89 | #include "br_fat16_0x0.h" 90 | #include "br_fat16fd_0x3e.h" 91 | 92 | if(bKeepLabel) 93 | return 94 | ( write_data(fp, 0x0, br_fat16_0x0, sizeof(br_fat16_0x0)) && 95 | /* BIOS Parameter Block should not be overwritten */ 96 | write_data(fp, 0x3e, br_fat16_0x3e, sizeof(br_fat16_0x3e)) ); 97 | else 98 | return 99 | ( write_data(fp, 0x0, br_fat16_0x0, sizeof(br_fat16_0x0)) && 100 | /* BIOS Parameter Block should not be overwritten */ 101 | write_data(fp, 0x2b, label_11_char, sizeof(label_11_char)) && 102 | write_data(fp, 0x3e, br_fat16_0x3e, sizeof(br_fat16_0x3e)) ); 103 | } /* write_fat_16_fd_br */ 104 | 105 | int entire_fat_16_ros_br_matches(FILE *fp) 106 | { 107 | #include "br_fat16ros_0x0.h" 108 | #include "br_fat16ros_0x3e.h" 109 | 110 | return 111 | ( contains_data(fp, 0x0, br_fat16_0x0, sizeof(br_fat16_0x0)) && 112 | /* BIOS Parameter Block might differ between systems */ 113 | contains_data(fp, 0x3e, br_fat16_0x3e, sizeof(br_fat16_0x3e)) ); 114 | } /* entire_fat_16_ros_br_matches */ 115 | 116 | int write_fat_16_ros_br(FILE *fp, int bKeepLabel) 117 | { 118 | #include "label_11_char.h" 119 | #include "br_fat16ros_0x0.h" 120 | #include "br_fat16ros_0x3e.h" 121 | 122 | if(bKeepLabel) 123 | return 124 | ( write_data(fp, 0x0, br_fat16_0x0, sizeof(br_fat16_0x0)) && 125 | /* BIOS Parameter Block should not be overwritten */ 126 | write_data(fp, 0x3e, br_fat16_0x3e, sizeof(br_fat16_0x3e)) ); 127 | else 128 | return 129 | ( write_data(fp, 0x0, br_fat16_0x0, sizeof(br_fat16_0x0)) && 130 | /* BIOS Parameter Block should not be overwritten */ 131 | write_data(fp, 0x2b, label_11_char, sizeof(label_11_char)) && 132 | write_data(fp, 0x3e, br_fat16_0x3e, sizeof(br_fat16_0x3e)) ); 133 | } /* write_fat_16_ros_br */ 134 | -------------------------------------------------------------------------------- /inc/br.h: -------------------------------------------------------------------------------- 1 | #ifndef BR_H 2 | #define BR_H 3 | 4 | #include 5 | #include 6 | 7 | /* Sets custom number of bytes per sector, default value is 512 */ 8 | void set_bytes_per_sector(unsigned long ulValue); 9 | 10 | /* Gets Windows Disk Signature from MBR */ 11 | uint32_t read_windows_disk_signature(FILE *fp); 12 | 13 | /* Sets a new Windows Disk Signature to MBR */ 14 | int write_windows_disk_signature(FILE *fp, uint32_t tWDS); 15 | 16 | /* Reads copy protect bytes after Windows Disk Signature from MBR */ 17 | uint16_t read_mbr_copy_protect_bytes(FILE *fp); 18 | const char *read_mbr_copy_protect_bytes_explained(FILE *fp); 19 | 20 | /* returns TRUE if the file has a boot record, otherwise FALSE. 21 | The file position will change when this function is called! */ 22 | int is_br(FILE *fp); 23 | 24 | /* returns TRUE if the file has a LILO boot record, otherwise FALSE. 25 | The file position will change when this function is called! */ 26 | int is_lilo_br(FILE *fp); 27 | 28 | /* returns TRUE if the file has a Microsoft dos master boot record, otherwise 29 | FALSE.The file position will change when this function is called! */ 30 | int is_dos_mbr(FILE *fp); 31 | 32 | /* returns TRUE if the file has a Microsoft dos master boot record with the 33 | undocumented F2 instruction, otherwise FALSE. The file position will change 34 | when this function is called! */ 35 | int is_dos_f2_mbr(FILE *fp); 36 | 37 | /* returns TRUE if the file has a Microsoft 95b master boot record, otherwise 38 | FALSE.The file position will change when this function is called! */ 39 | int is_95b_mbr(FILE *fp); 40 | 41 | /* returns TRUE if the file has a Microsoft 2000 master boot record, otherwise 42 | FALSE.The file position will change when this function is called! */ 43 | int is_2000_mbr(FILE *fp); 44 | 45 | /* returns TRUE if the file has a Microsoft Vista master boot record, otherwise 46 | FALSE.The file position will change when this function is called! */ 47 | int is_vista_mbr(FILE *fp); 48 | 49 | /* returns TRUE if the file has a Microsoft 7 master boot record, otherwise 50 | FALSE.The file position will change when this function is called! */ 51 | int is_win7_mbr(FILE *fp); 52 | 53 | /* returns TRUE if the file has a Rufus master boot record, otherwise 54 | FALSE.The file position will change when this function is called! */ 55 | int is_rufus_mbr(FILE *fp); 56 | 57 | /* returns TRUE if the file has a ReactOS master boot record, otherwise 58 | FALSE.The file position will change when this function is called! */ 59 | int is_reactos_mbr(FILE *fp); 60 | 61 | /* returns TRUE if the file has a Grub4DOS master boot record, otherwise 62 | FALSE.The file position will change when this function is called! */ 63 | int is_grub4dos_mbr(FILE *fp); 64 | 65 | /* returns TRUE if the file has a Grub 2.0 master boot record, otherwise 66 | FALSE.The file position will change when this function is called! */ 67 | int is_grub2_mbr(FILE *fp); 68 | 69 | /* returns TRUE if the file has a KolibriOS master boot record, otherwise 70 | FALSE.The file position will change when this function is called! */ 71 | int is_kolibrios_mbr(FILE *fp); 72 | 73 | /* returns TRUE if the file has a syslinux master boot record, otherwise 74 | FALSE.The file position will change when this function is called! */ 75 | int is_syslinux_mbr(FILE *fp); 76 | 77 | /* returns TRUE if the file has a syslinux GPT master boot record, otherwise 78 | FALSE.The file position will change when this function is called! */ 79 | int is_syslinux_gpt_mbr(FILE *fp); 80 | 81 | /* returns TRUE if the file has a zeroed master boot record, otherwise 82 | FALSE.The file position will change when this function is called! */ 83 | int is_zero_mbr(FILE *fp); 84 | int is_zero_mbr_not_including_disk_signature_or_copy_protect(FILE *fp); 85 | 86 | /* Writes a dos master boot record to a file, returns TRUE on success, otherwise 87 | FALSE */ 88 | int write_dos_mbr(FILE *fp); 89 | 90 | /* Writes a 95b master boot record to a file, returns TRUE on success, otherwise 91 | FALSE */ 92 | int write_95b_mbr(FILE *fp); 93 | 94 | /* Writes a 2000 master boot record to a file, returns TRUE on success, otherwise 95 | FALSE */ 96 | int write_2000_mbr(FILE *fp); 97 | 98 | /* Writes a Vista master boot record to a file, returns TRUE on success, otherwise 99 | FALSE */ 100 | int write_vista_mbr(FILE *fp); 101 | 102 | /* Writes a Windows 7 master boot record to a file, returns TRUE on success, otherwise 103 | FALSE */ 104 | int write_win7_mbr(FILE *fp); 105 | 106 | /* Writes a Rufus master boot record to a file, returns TRUE on success, otherwise 107 | FALSE */ 108 | int write_rufus_mbr(FILE *fp); 109 | 110 | /* Writes a ReactOS master boot record to a file, returns TRUE on success, otherwise 111 | FALSE */ 112 | int write_reactos_mbr(FILE *fp); 113 | 114 | /* Writes a Grub4DOS master boot record to a file, returns TRUE on success, otherwise 115 | FALSE */ 116 | int write_grub4dos_mbr(FILE *fp); 117 | 118 | /* Writes a Grub 2.0 master boot record to a file, returns TRUE on success, otherwise 119 | FALSE */ 120 | int write_grub2_mbr(FILE *fp); 121 | 122 | /* Writes a KolibriOS master boot record to a file, returns TRUE on success, otherwise 123 | FALSE */ 124 | int write_kolibrios_mbr(FILE *fp); 125 | 126 | /* Writes a syslinux master boot record to a file, returns TRUE on success, otherwise 127 | FALSE */ 128 | int write_syslinux_mbr(FILE *fp); 129 | 130 | /* Writes a syslinux GPT master boot record to a file, returns TRUE on success, otherwise 131 | FALSE */ 132 | int write_syslinux_gpt_mbr(FILE *fp); 133 | 134 | /* Writes an empty (zeroed) master boot record to a file, returns TRUE on success, otherwise 135 | FALSE */ 136 | int write_zero_mbr(FILE *fp); 137 | 138 | #endif 139 | -------------------------------------------------------------------------------- /inc/br_fat32ros_0x52.h: -------------------------------------------------------------------------------- 1 | unsigned char br_fat32ros_0x52[] = { 2 | 0x46, 0x41, 0x54, 0x33, 0x32, 0x20, 0x20, 0x20, 0x31, 0xc0, 0x8e, 0xd8, 3 | 0x8e, 0xc0, 0x8e, 0xd0, 0xbd, 0x00, 0x7c, 0xbc, 0x00, 0x7c, 0x80, 0xbe, 4 | 0x40, 0x00, 0xff, 0x75, 0x04, 0x88, 0x96, 0x40, 0x00, 0x83, 0xbe, 0x16, 5 | 0x00, 0x00, 0x75, 0x0f, 0x66, 0x83, 0xbe, 0x11, 0x00, 0x00, 0x75, 0x07, 6 | 0x83, 0xbe, 0x2a, 0x00, 0x00, 0x76, 0x03, 0xe9, 0x07, 0x01, 0xb8, 0x00, 7 | 0x08, 0x8a, 0x96, 0x40, 0x00, 0xcd, 0x13, 0x73, 0x05, 0xb9, 0xff, 0xff, 8 | 0x88, 0xce, 0x88, 0xeb, 0x88, 0xcf, 0xc0, 0xef, 0x06, 0x80, 0xe1, 0x3f, 9 | 0x66, 0x0f, 0xb6, 0xc6, 0x66, 0x0f, 0xb7, 0xdb, 0x66, 0x0f, 0xb6, 0xc9, 10 | 0x66, 0x40, 0x66, 0x43, 0x66, 0xf7, 0xe1, 0x66, 0xf7, 0xe3, 0x66, 0xa3, 11 | 0xb4, 0x7d, 0x66, 0xb8, 0x0e, 0x00, 0x00, 0x00, 0x66, 0x03, 0x86, 0x1c, 12 | 0x00, 0xb9, 0x01, 0x00, 0x31, 0xdb, 0x8e, 0xc3, 0xbb, 0x00, 0x7e, 0xe8, 13 | 0x03, 0x00, 0xe9, 0x25, 0x01, 0x06, 0x66, 0x3b, 0x06, 0xb4, 0x7d, 0x73, 14 | 0x1c, 0x66, 0x60, 0xb4, 0x41, 0xbb, 0xaa, 0x55, 0x8a, 0x96, 0x40, 0x00, 15 | 0xcd, 0x13, 0x72, 0x57, 0x81, 0xfb, 0x55, 0xaa, 0x75, 0x51, 0xf6, 0xc1, 16 | 0x01, 0x74, 0x4c, 0x66, 0x61, 0x66, 0x60, 0x83, 0xf9, 0x40, 0x76, 0x03, 17 | 0xb9, 0x40, 0x00, 0x89, 0x0e, 0x45, 0x7d, 0x6a, 0x00, 0x6a, 0x00, 0x66, 18 | 0x50, 0x06, 0x53, 0x51, 0x6a, 0x10, 0x89, 0xe6, 0x8a, 0x96, 0x40, 0x00, 19 | 0xb4, 0x42, 0xcd, 0x13, 0x72, 0x67, 0x83, 0xc4, 0x10, 0x66, 0x61, 0x53, 20 | 0x66, 0x8b, 0x1e, 0x45, 0x7d, 0x66, 0x01, 0xd8, 0x66, 0xc1, 0xe3, 0x05, 21 | 0x8c, 0xc2, 0x01, 0xda, 0x8e, 0xc2, 0x5b, 0x2b, 0x0e, 0x45, 0x7d, 0x75, 22 | 0xbc, 0x07, 0xc3, 0x00, 0x00, 0x00, 0x00, 0x66, 0x61, 0x66, 0x60, 0x66, 23 | 0x31, 0xd2, 0x66, 0x0f, 0xb7, 0x8e, 0x18, 0x00, 0x66, 0xf7, 0xf1, 0xfe, 24 | 0xc2, 0x88, 0xd1, 0x66, 0x89, 0xc2, 0x66, 0xc1, 0xea, 0x10, 0xf7, 0xb6, 25 | 0x1a, 0x00, 0x88, 0xd6, 0x8a, 0x96, 0x40, 0x00, 0x88, 0xc5, 0xd0, 0xcc, 26 | 0xd0, 0xcc, 0x08, 0xe1, 0xb8, 0x01, 0x02, 0xcd, 0x13, 0x72, 0x0e, 0x66, 27 | 0x61, 0x66, 0x40, 0x8c, 0xc2, 0x83, 0xc2, 0x20, 0x8e, 0xc2, 0xe2, 0xc1, 28 | 0xc3, 0xbe, 0xb8, 0x7d, 0xe8, 0x14, 0x00, 0xeb, 0x06, 0xbe, 0xc5, 0x7d, 29 | 0xe8, 0x0c, 0x00, 0xbe, 0xd9, 0x7d, 0xe8, 0x06, 0x00, 0x31, 0xc0, 0xcd, 30 | 0x16, 0xcd, 0x19, 0xac, 0x08, 0xc0, 0x74, 0x09, 0xb4, 0x0e, 0xbb, 0x07, 31 | 0x00, 0xcd, 0x10, 0xeb, 0xf2, 0xc3, 0x00, 0x00, 0x00, 0x00, 0x44, 0x69, 32 | 0x73, 0x6b, 0x20, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x0d, 0x0a, 0x00, 0x46, 33 | 0x69, 0x6c, 0x65, 0x20, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x20, 0x65, 34 | 0x72, 0x72, 0x6f, 0x72, 0x0d, 0x0a, 0x00, 0x50, 0x72, 0x65, 0x73, 0x73, 35 | 0x20, 0x61, 0x6e, 0x79, 0x20, 0x6b, 0x65, 0x79, 0x20, 0x74, 0x6f, 0x20, 36 | 0x72, 0x65, 0x73, 0x74, 0x61, 0x72, 0x74, 0x0d, 0x0a, 0x00, 0x00, 0x00, 37 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0xaa, 0x52, 0x52, 38 | 0x61, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 39 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 40 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 41 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 42 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 43 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 44 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 45 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 46 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 47 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 48 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 49 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 50 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 51 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 52 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 53 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 54 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 55 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 56 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 57 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 58 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 59 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 60 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 61 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 62 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 63 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 64 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 65 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 66 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 67 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 68 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 69 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 70 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 71 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 72 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 73 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 74 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 75 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 76 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 77 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 78 | 0x00, 0x00, 0x72, 0x72, 0x41, 0x61 79 | }; 80 | -------------------------------------------------------------------------------- /inc/br_fat32_0x52.h: -------------------------------------------------------------------------------- 1 | unsigned char br_fat32_0x52[] = { 2 | 0x46, 0x41, 3 | 0x54, 0x33, 0x32, 0x20, 0x20, 0x20, 0xfa, 0x33, 0xc9, 0x8e, 0xd1, 0xbc, 4 | 0xf8, 0x7b, 0x8e, 0xc1, 0xbd, 0x78, 0x00, 0xc5, 0x76, 0x00, 0x1e, 0x56, 5 | 0x16, 0x55, 0xbf, 0x22, 0x05, 0x89, 0x7e, 0x00, 0x89, 0x4e, 0x02, 0xb1, 6 | 0x0b, 0xfc, 0xf3, 0xa4, 0x8e, 0xd9, 0xbd, 0x00, 0x7c, 0xc6, 0x45, 0xfe, 7 | 0x0f, 0x8b, 0x46, 0x18, 0x88, 0x45, 0xf9, 0x38, 0x4e, 0x40, 0x7d, 0x25, 8 | 0x8b, 0xc1, 0x99, 0xbb, 0x00, 0x07, 0xe8, 0x97, 0x00, 0x72, 0x1a, 0x83, 9 | 0xeb, 0x3a, 0x66, 0xa1, 0x1c, 0x7c, 0x66, 0x3b, 0x07, 0x8a, 0x57, 0xfc, 10 | 0x75, 0x06, 0x80, 0xca, 0x02, 0x88, 0x56, 0x02, 0x80, 0xc3, 0x10, 0x73, 11 | 0xed, 0xbf, 0x02, 0x00, 0x83, 0x7e, 0x16, 0x00, 0x75, 0x45, 0x8b, 0x46, 12 | 0x1c, 0x8b, 0x56, 0x1e, 0xb9, 0x03, 0x00, 0x49, 0x40, 0x75, 0x01, 0x42, 13 | 0xbb, 0x00, 0x7e, 0xe8, 0x5f, 0x00, 0x73, 0x26, 0xb0, 0xf8, 0x4f, 0x74, 14 | 0x1d, 0x8b, 0x46, 0x32, 0x33, 0xd2, 0xb9, 0x03, 0x00, 0x3b, 0xc8, 0x77, 15 | 0x1e, 0x8b, 0x76, 0x0e, 0x3b, 0xce, 0x73, 0x17, 0x2b, 0xf1, 0x03, 0x46, 16 | 0x1c, 0x13, 0x56, 0x1e, 0xeb, 0xd1, 0x73, 0x0b, 0xeb, 0x27, 0x83, 0x7e, 17 | 0x2a, 0x00, 0x77, 0x03, 0xe9, 0xfd, 0x02, 0xbe, 0x7e, 0x7d, 0xac, 0x98, 18 | 0x03, 0xf0, 0xac, 0x84, 0xc0, 0x74, 0x17, 0x3c, 0xff, 0x74, 0x09, 0xb4, 19 | 0x0e, 0xbb, 0x07, 0x00, 0xcd, 0x10, 0xeb, 0xee, 0xbe, 0x81, 0x7d, 0xeb, 20 | 0xe5, 0xbe, 0x7f, 0x7d, 0xeb, 0xe0, 0x98, 0xcd, 0x16, 0x5e, 0x1f, 0x66, 21 | 0x8f, 0x04, 0xcd, 0x19, 0x41, 0x56, 0x66, 0x6a, 0x00, 0x52, 0x50, 0x06, 22 | 0x53, 0x6a, 0x01, 0x6a, 0x10, 0x8b, 0xf4, 0x60, 0x80, 0x7e, 0x02, 0x0e, 23 | 0x75, 0x04, 0xb4, 0x42, 0xeb, 0x1d, 0x91, 0x92, 0x33, 0xd2, 0xf7, 0x76, 24 | 0x18, 0x91, 0xf7, 0x76, 0x18, 0x42, 0x87, 0xca, 0xf7, 0x76, 0x1a, 0x8a, 25 | 0xf2, 0x8a, 0xe8, 0xc0, 0xcc, 0x02, 0x0a, 0xcc, 0xb8, 0x01, 0x02, 0x8a, 26 | 0x56, 0x40, 0xcd, 0x13, 0x61, 0x8d, 0x64, 0x10, 0x5e, 0x72, 0x0a, 0x40, 27 | 0x75, 0x01, 0x42, 0x03, 0x5e, 0x0b, 0x49, 0x75, 0xb4, 0xc3, 0x03, 0x18, 28 | 0x01, 0x27, 0x0d, 0x0a, 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x20, 29 | 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x20, 0x64, 0x69, 0x73, 0x6b, 0xff, 30 | 0x0d, 0x0a, 0x44, 0x69, 0x73, 0x6b, 0x20, 0x49, 0x2f, 0x4f, 0x20, 0x65, 31 | 0x72, 0x72, 0x6f, 0x72, 0xff, 0x0d, 0x0a, 0x52, 0x65, 0x70, 0x6c, 0x61, 32 | 0x63, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x64, 0x69, 0x73, 0x6b, 0x2c, 33 | 0x20, 0x61, 0x6e, 0x64, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x20, 0x70, 0x72, 34 | 0x65, 0x73, 0x73, 0x20, 0x61, 0x6e, 0x79, 0x20, 0x6b, 0x65, 0x79, 0x0d, 35 | 0x0a, 0x00, 0x00, 0x00, 0x49, 0x4f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 36 | 0x53, 0x59, 0x53, 0x4d, 0x53, 0x44, 0x4f, 0x53, 0x20, 0x20, 0x20, 0x53, 37 | 0x59, 0x53, 0x7e, 0x01, 0x00, 0x57, 0x49, 0x4e, 0x42, 0x4f, 0x4f, 0x54, 38 | 0x20, 0x53, 0x59, 0x53, 0x00, 0x00, 0x55, 0xaa, 0x52, 0x52, 0x61, 0x41, 39 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 40 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 41 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 42 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 43 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 44 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 45 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 46 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 47 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 48 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 49 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 50 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 51 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 52 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 53 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 54 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 55 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 56 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 57 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 58 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 59 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 60 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 61 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 62 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 63 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 64 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 65 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 66 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 67 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 68 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 69 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 70 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 71 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 72 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 73 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 74 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 75 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 76 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 77 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 78 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 79 | 0x72, 0x72, 0x41, 0x61 80 | }; 81 | -------------------------------------------------------------------------------- /inc/br_fat32nt_0x52.h: -------------------------------------------------------------------------------- 1 | unsigned char br_fat32nt_0x52[] = { 2 | 0x46, 0x41, 3 | 0x54, 0x33, 0x32, 0x20, 0x20, 0x20, 0x33, 0xc9, 0x8e, 0xd1, 0xbc, 0xf4, 4 | 0x7b, 0x8e, 0xc1, 0x8e, 0xd9, 0xbd, 0x00, 0x7c, 0x88, 0x4e, 0x02, 0x8a, 5 | 0x56, 0x40, 0xb4, 0x08, 0xcd, 0x13, 0x73, 0x05, 0xb9, 0xff, 0xff, 0x8a, 6 | 0xf1, 0x66, 0x0f, 0xb6, 0xc6, 0x40, 0x66, 0x0f, 0xb6, 0xd1, 0x80, 0xe2, 7 | 0x3f, 0xf7, 0xe2, 0x86, 0xcd, 0xc0, 0xed, 0x06, 0x41, 0x66, 0x0f, 0xb7, 8 | 0xc9, 0x66, 0xf7, 0xe1, 0x66, 0x89, 0x46, 0xf8, 0x83, 0x7e, 0x16, 0x00, 9 | 0x75, 0x38, 0x83, 0x7e, 0x2a, 0x00, 0x77, 0x32, 0x66, 0x8b, 0x46, 0x1c, 10 | 0x66, 0x83, 0xc0, 0x0c, 0xbb, 0x00, 0x80, 0xb9, 0x01, 0x00, 0xe8, 0x2b, 11 | 0x00, 0xe9, 0x48, 0x03, 0xa0, 0xfa, 0x7d, 0xb4, 0x7d, 0x8b, 0xf0, 0xac, 12 | 0x84, 0xc0, 0x74, 0x17, 0x3c, 0xff, 0x74, 0x09, 0xb4, 0x0e, 0xbb, 0x07, 13 | 0x00, 0xcd, 0x10, 0xeb, 0xee, 0xa0, 0xfb, 0x7d, 0xeb, 0xe5, 0xa0, 0xf9, 14 | 0x7d, 0xeb, 0xe0, 0x98, 0xcd, 0x16, 0xcd, 0x19, 0x66, 0x60, 0x66, 0x3b, 15 | 0x46, 0xf8, 0x0f, 0x82, 0x4a, 0x00, 0x66, 0x6a, 0x00, 0x66, 0x50, 0x06, 16 | 0x53, 0x66, 0x68, 0x10, 0x00, 0x01, 0x00, 0x80, 0x7e, 0x02, 0x00, 0x0f, 17 | 0x85, 0x20, 0x00, 0xb4, 0x41, 0xbb, 0xaa, 0x55, 0x8a, 0x56, 0x40, 0xcd, 18 | 0x13, 0x0f, 0x82, 0x1c, 0x00, 0x81, 0xfb, 0x55, 0xaa, 0x0f, 0x85, 0x14, 19 | 0x00, 0xf6, 0xc1, 0x01, 0x0f, 0x84, 0x0d, 0x00, 0xfe, 0x46, 0x02, 0xb4, 20 | 0x42, 0x8a, 0x56, 0x40, 0x8b, 0xf4, 0xcd, 0x13, 0xb0, 0xf9, 0x66, 0x58, 21 | 0x66, 0x58, 0x66, 0x58, 0x66, 0x58, 0xeb, 0x2a, 0x66, 0x33, 0xd2, 0x66, 22 | 0x0f, 0xb7, 0x4e, 0x18, 0x66, 0xf7, 0xf1, 0xfe, 0xc2, 0x8a, 0xca, 0x66, 23 | 0x8b, 0xd0, 0x66, 0xc1, 0xea, 0x10, 0xf7, 0x76, 0x1a, 0x86, 0xd6, 0x8a, 24 | 0x56, 0x40, 0x8a, 0xe8, 0xc0, 0xe4, 0x06, 0x0a, 0xcc, 0xb8, 0x01, 0x02, 25 | 0xcd, 0x13, 0x66, 0x61, 0x0f, 0x82, 0x54, 0xff, 0x81, 0xc3, 0x00, 0x02, 26 | 0x66, 0x40, 0x49, 0x0f, 0x85, 0x71, 0xff, 0xc3, 0x4e, 0x54, 0x4c, 0x44, 27 | 0x52, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 28 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 29 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 30 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 31 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, 0x0a, 0x4e, 0x54, 32 | 0x4c, 0x44, 0x52, 0x20, 0x69, 0x73, 0x20, 0x6d, 0x69, 0x73, 0x73, 0x69, 33 | 0x6e, 0x67, 0xff, 0x0d, 0x0a, 0x44, 0x69, 0x73, 0x6b, 0x20, 0x65, 0x72, 34 | 0x72, 0x6f, 0x72, 0xff, 0x0d, 0x0a, 0x50, 0x72, 0x65, 0x73, 0x73, 0x20, 35 | 0x61, 0x6e, 0x79, 0x20, 0x6b, 0x65, 0x79, 0x20, 0x74, 0x6f, 0x20, 0x72, 36 | 0x65, 0x73, 0x74, 0x61, 0x72, 0x74, 0x0d, 0x0a, 0x00, 0x00, 0x00, 0x00, 37 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 38 | 0x00, 0xac, 0xbf, 0xcc, 0x00, 0x00, 0x55, 0xaa, 0x52, 0x52, 0x61, 0x41, 39 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 40 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 41 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 42 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 43 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 44 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 45 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 46 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 47 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 48 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 49 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 50 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 51 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 52 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 53 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 54 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 55 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 56 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 57 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 58 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 59 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 60 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 61 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 62 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 63 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 64 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 65 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 66 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 67 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 68 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 69 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 70 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 71 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 72 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 73 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 74 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 75 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 76 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 77 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 78 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 79 | 0x72, 0x72, 0x41, 0x61 80 | }; 81 | -------------------------------------------------------------------------------- /inc/br_fat32pe_0x52.h: -------------------------------------------------------------------------------- 1 | unsigned char br_fat32pe_0x52[] = { 2 | 0x46, 0x41, 3 | 0x54, 0x33, 0x32, 0x20, 0x20, 0x20, 0x33, 0xc9, 0x8e, 0xd1, 0xbc, 0xf4, 4 | 0x7b, 0x8e, 0xc1, 0x8e, 0xd9, 0xbd, 0x00, 0x7c, 0x88, 0x4e, 0x02, 0x8a, 5 | 0x56, 0x40, 0xb4, 0x41, 0xbb, 0xaa, 0x55, 0xcd, 0x13, 0x72, 0x10, 0x81, 6 | 0xfb, 0x55, 0xaa, 0x75, 0x0a, 0xf6, 0xc1, 0x01, 0x74, 0x05, 0xfe, 0x46, 7 | 0x02, 0xeb, 0x2d, 0x8a, 0x56, 0x40, 0xb4, 0x08, 0xcd, 0x13, 0x73, 0x05, 8 | 0xb9, 0xff, 0xff, 0x8a, 0xf1, 0x66, 0x0f, 0xb6, 0xc6, 0x40, 0x66, 0x0f, 9 | 0xb6, 0xd1, 0x80, 0xe2, 0x3f, 0xf7, 0xe2, 0x86, 0xcd, 0xc0, 0xed, 0x06, 10 | 0x41, 0x66, 0x0f, 0xb7, 0xc9, 0x66, 0xf7, 0xe1, 0x66, 0x89, 0x46, 0xf8, 11 | 0x83, 0x7e, 0x16, 0x00, 0x75, 0x38, 0x83, 0x7e, 0x2a, 0x00, 0x77, 0x32, 12 | 0x66, 0x8b, 0x46, 0x1c, 0x66, 0x83, 0xc0, 0x0c, 0xbb, 0x00, 0x80, 0xb9, 13 | 0x01, 0x00, 0xe8, 0x2b, 0x00, 0xe9, 0x2c, 0x03, 0xa0, 0xfa, 0x7d, 0xb4, 14 | 0x7d, 0x8b, 0xf0, 0xac, 0x84, 0xc0, 0x74, 0x17, 0x3c, 0xff, 0x74, 0x09, 15 | 0xb4, 0x0e, 0xbb, 0x07, 0x00, 0xcd, 0x10, 0xeb, 0xee, 0xa0, 0xfb, 0x7d, 16 | 0xeb, 0xe5, 0xa0, 0xf9, 0x7d, 0xeb, 0xe0, 0x98, 0xcd, 0x16, 0xcd, 0x19, 17 | 0x66, 0x60, 0x80, 0x7e, 0x02, 0x00, 0x0f, 0x84, 0x20, 0x00, 0x66, 0x6a, 18 | 0x00, 0x66, 0x50, 0x06, 0x53, 0x66, 0x68, 0x10, 0x00, 0x01, 0x00, 0xb4, 19 | 0x42, 0x8a, 0x56, 0x40, 0x8b, 0xf4, 0xcd, 0x13, 0x66, 0x58, 0x66, 0x58, 20 | 0x66, 0x58, 0x66, 0x58, 0xeb, 0x33, 0x66, 0x3b, 0x46, 0xf8, 0x72, 0x03, 21 | 0xf9, 0xeb, 0x2a, 0x66, 0x33, 0xd2, 0x66, 0x0f, 0xb7, 0x4e, 0x18, 0x66, 22 | 0xf7, 0xf1, 0xfe, 0xc2, 0x8a, 0xca, 0x66, 0x8b, 0xd0, 0x66, 0xc1, 0xea, 23 | 0x10, 0xf7, 0x76, 0x1a, 0x86, 0xd6, 0x8a, 0x56, 0x40, 0x8a, 0xe8, 0xc0, 24 | 0xe4, 0x06, 0x0a, 0xcc, 0xb8, 0x01, 0x02, 0xcd, 0x13, 0x66, 0x61, 0x0f, 25 | 0x82, 0x75, 0xff, 0x81, 0xc3, 0x00, 0x02, 0x66, 0x40, 0x49, 0x75, 0x94, 26 | 0xc3, 0x42, 0x4f, 0x4f, 0x54, 0x4d, 0x47, 0x52, 0x20, 0x20, 0x20, 0x20, 27 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 28 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 29 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 30 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 31 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, 0x0a, 0x42, 0x4f, 32 | 0x4f, 0x54, 0x4d, 0x47, 0x52, 0x20, 0x69, 0x73, 0x20, 0x6d, 0x69, 0x73, 33 | 0x73, 0x69, 0x6e, 0x67, 0xff, 0x0d, 0x0a, 0x44, 0x69, 0x73, 0x6b, 0x20, 34 | 0x65, 0x72, 0x72, 0x6f, 0x72, 0xff, 0x0d, 0x0a, 0x50, 0x72, 0x65, 0x73, 35 | 0x73, 0x20, 0x61, 0x6e, 0x79, 0x20, 0x6b, 0x65, 0x79, 0x20, 0x74, 0x6f, 36 | 0x20, 0x72, 0x65, 0x73, 0x74, 0x61, 0x72, 0x74, 0x0d, 0x0a, 0x00, 0x00, 37 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 38 | 0x00, 0xac, 0xc1, 0xce, 0x00, 0x00, 0x55, 0xaa, 0x52, 0x52, 0x61, 0x41, 39 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 40 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 41 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 42 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 43 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 44 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 45 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 46 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 47 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 48 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 49 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 50 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 51 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 52 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 53 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 54 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 55 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 56 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 57 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 58 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 59 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 60 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 61 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 62 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 63 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 64 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 65 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 66 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 67 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 68 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 69 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 70 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 71 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 72 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 73 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 74 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 75 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 76 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 77 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 78 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 79 | 0x72, 0x72, 0x41, 0x61, 0x00, 0x00, 0x00, 0x00, 0x02 80 | }; 81 | -------------------------------------------------------------------------------- /inc/br_fat32fd_0x52.h: -------------------------------------------------------------------------------- 1 | /* br_fat32_0x52.h 2 | // 3 | // ANI 4 | // substring gmbh/tw 14.9.04 5 | // modified bootstrap code 0x052 to support FreeDOS 6 | */ 7 | unsigned char br_fat32_0x52[] = { 8 | 0x46, 0x41, 0x54, 0x33, 0x32, 0x20, 0x20, 0x20, 0xfc, 0xfa, 0x29, 0xc0, 9 | 0x8e, 0xd8, 0xbd, 0x00, 0x7c, 0xb8, 0xe0, 0x1f, 0x8e, 0xc0, 0x89, 0xee, 10 | 0x89, 0xef, 0xb9, 0x00, 0x01, 0xf3, 0xa5, 0xea, 0x7a, 0x7c, 0xe0, 0x1f, 11 | 0x00, 0x00, 0x60, 0x00, 0x8e, 0xd8, 0x8e, 0xd0, 0x8d, 0x66, 0xe0, 0xfb, 12 | 0x88, 0x56, 0x40, 0xbe, 0xc1, 0x7d, 0xe8, 0xf4, 0x00, 0x66, 0x31, 0xc0, 13 | 0x66, 0x89, 0x46, 0x44, 0x8b, 0x46, 0x0e, 0x66, 0x03, 0x46, 0x1c, 0x66, 14 | 0x89, 0x46, 0x48, 0x66, 0x89, 0x46, 0x4c, 0x66, 0x8b, 0x46, 0x10, 0x66, 15 | 0xf7, 0x6e, 0x24, 0x66, 0x01, 0x46, 0x4c, 0xb8, 0x00, 0x02, 0x3b, 0x46, 16 | 0x0b, 0x74, 0x08, 0x01, 0xc0, 0xff, 0x06, 0x34, 0x7d, 0xeb, 0xf3, 0x66, 17 | 0x8b, 0x46, 0x2c, 0x66, 0x50, 0xe8, 0x94, 0x00, 0x72, 0x4d, 0xc4, 0x5e, 18 | 0x76, 0xe8, 0xb7, 0x00, 0x31, 0xff, 0xb9, 0x0b, 0x00, 0xbe, 0xf1, 0x7d, 19 | 0xf3, 0xa6, 0x74, 0x15, 0x83, 0xc7, 0x20, 0x83, 0xe7, 0xe0, 0x3b, 0x7e, 20 | 0x0b, 0x75, 0xeb, 0x4a, 0x75, 0xe0, 0x66, 0x58, 0xe8, 0x34, 0x00, 0xeb, 21 | 0xd2, 0x26, 0xff, 0x75, 0x09, 0x26, 0xff, 0x75, 0x0f, 0x66, 0x58, 0x29, 22 | 0xdb, 0x66, 0x50, 0xe8, 0x5a, 0x00, 0x72, 0x0d, 0xe8, 0x80, 0x00, 0x4a, 23 | 0x75, 0xfa, 0x66, 0x58, 0xe8, 0x14, 0x00, 0xeb, 0xec, 0x8a, 0x5e, 0x40, 24 | 0xff, 0x6e, 0x76, 0xbe, 0xee, 0x7d, 0xe8, 0x64, 0x00, 0x30, 0xe4, 0xcd, 25 | 0x16, 0xcd, 0x19, 0x06, 0x57, 0x53, 0x89, 0xc7, 0xc1, 0xe7, 0x02, 0x50, 26 | 0x8b, 0x46, 0x0b, 0x48, 0x21, 0xc7, 0x58, 0x66, 0xc1, 0xe8, 0x07, 0x66, 27 | 0x03, 0x46, 0x48, 0xbb, 0x00, 0x20, 0x8e, 0xc3, 0x29, 0xdb, 0x66, 0x3b, 28 | 0x46, 0x44, 0x74, 0x07, 0x66, 0x89, 0x46, 0x44, 0xe8, 0x38, 0x00, 0x26, 29 | 0x80, 0x65, 0x03, 0x0f, 0x26, 0x66, 0x8b, 0x05, 0x5b, 0x5f, 0x07, 0xc3, 30 | 0x66, 0x3d, 0xf8, 0xff, 0xff, 0x0f, 0x73, 0x15, 0x66, 0x48, 0x66, 0x48, 31 | 0x66, 0x0f, 0xb6, 0x56, 0x0d, 0x66, 0x52, 0x66, 0xf7, 0xe2, 0x66, 0x5a, 32 | 0x66, 0x03, 0x46, 0x4c, 0xc3, 0xf9, 0xc3, 0x31, 0xdb, 0xb4, 0x0e, 0xcd, 33 | 0x10, 0xac, 0x3c, 0x00, 0x75, 0xf5, 0xc3, 0x52, 0x56, 0x57, 0x66, 0x50, 34 | 0x89, 0xe7, 0x6a, 0x00, 0x6a, 0x00, 0x66, 0x50, 0x06, 0x53, 0x6a, 0x01, 35 | 0x6a, 0x10, 0x89, 0xe6, 0x8a, 0x56, 0x40, 0xb4, 0x42, 0xcd, 0x13, 0x89, 36 | 0xfc, 0x66, 0x58, 0x73, 0x08, 0x50, 0x30, 0xe4, 0xcd, 0x13, 0x58, 0xeb, 37 | 0xd9, 0x66, 0x40, 0x03, 0x5e, 0x0b, 0x73, 0x07, 0x8c, 0xc2, 0x80, 0xc6, 38 | 0x10, 0x8e, 0xc2, 0x5f, 0x5e, 0x5a, 0xc3, 0x4c, 0x6f, 0x61, 0x64, 0x69, 39 | 0x6e, 0x67, 0x20, 0x46, 0x72, 0x65, 0x65, 0x44, 0x4f, 0x53, 0x20, 0x00, 40 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 41 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 42 | 0x00, 0x00, 0x00, 0x00, 0x4e, 0x6f, 0x20, 0x4b, 0x45, 0x52, 0x4e, 0x45, 43 | 0x4c, 0x20, 0x20, 0x53, 0x59, 0x53, 0x00, 0x00, 0x55, 0xaa, 0x52, 0x52, 44 | 0x61, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 45 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 46 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 47 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 48 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 49 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 50 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 51 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 52 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 53 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 54 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 55 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 56 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 57 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 58 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 59 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 60 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 61 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 62 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 63 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 64 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 65 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 66 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 67 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 68 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 69 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 70 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 71 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 72 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 73 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 74 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 75 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 76 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 77 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 78 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 79 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 80 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 81 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 82 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 83 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 84 | 0x00, 0x00, 0x72, 0x72, 0x41, 0x61 85 | }; 86 | 87 | -------------------------------------------------------------------------------- /man/ms-sys.1: -------------------------------------------------------------------------------- 1 | .\" Hey, EMACS: -*- nroff -*- 2 | .\" First parameter, NAME, should be all caps 3 | .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection 4 | .\" other parameters are allowed: see man(7), man(1) 5 | .TH MS-SYS 1 "December 26, 2015" 6 | .\" Please adjust this date whenever revising the manpage. 7 | .\" 8 | .\" Some roff macros, for reference: 9 | .\" .nh disable hyphenation 10 | .\" .hy enable hyphenation 11 | .\" .ad l left justify 12 | .\" .ad b justify to both left and right margins 13 | .\" .nf disable filling 14 | .\" .fi enable filling 15 | .\" .br insert line break 16 | .\" .sp insert n+1 empty lines 17 | .\" for manpage-specific macros, see man(7) 18 | .SH NAME 19 | ms-sys \- write Microsoft boot block 20 | .SH SYNOPSIS 21 | .B ms-sys 22 | .RI "[options] [device]" 23 | .SH DESCRIPTION 24 | \fBms-sys\fP is for writing Microsoft compatible boot records. 25 | .SH OPTIONS 26 | A summary of options is included below. 27 | .TP 28 | .B \-1, \-\-fat12 29 | Write a FAT12 floppy boot record to device. 30 | .TP 31 | .B \-2, \-\-fat32nt 32 | Write a FAT32 partition NT boot record to device. 33 | .TP 34 | .B \-e, \-\-fat32pe 35 | Write a FAT32 partition PE boot record to device, for USB install and recovery. 36 | .TP 37 | .B \-3, \-\-fat32 38 | Write a FAT32 partition DOS (Win9x) boot record to device. 39 | .TP 40 | .B \-4, \-\-fat32free 41 | Write a FAT32 partition FreeDOS boot record to device. 42 | .TP 43 | .B \-5, \-\-fat16free 44 | Write a FAT16 partition FreeDOS boot record to device. 45 | .TP 46 | .B \-6, \-\-fat16 47 | Write a FAT16 partition DOS (Win9x) boot record to device. 48 | .TP 49 | .B \-n, \-\-ntfs 50 | Write a NTFS partition Windows 7 boot record to device. This 51 | functionality should be considered experimental and probably 52 | is of no practical use. 53 | .TP 54 | .B \-o, \-\-fat16ros 55 | Write a FAT16 partition ReactOS boot record to device. 56 | .TP 57 | .B \-c, \-\-fat32ros 58 | Write a FAT32 partition ReactOS boot record to device. 59 | .TP 60 | .B \-q, \-\-fat32kos 61 | Write a FAT32 partition KolibriOS boot record to device. 62 | .TP 63 | .B \-l, \-\-wipelabel 64 | Reset partition disk label in boot record. 65 | .TP 66 | .B \-p, \-\-partition 67 | Write partition info (hidden sectors, heads and drive id) to boot 68 | record. This might be needed on some partitions depending on 69 | which program was used to create the file system. 70 | .TP 71 | .B \-H , \-\-heads 72 | Set number of heads written with -p switch. 73 | .TP 74 | .B \-O , \-\-writeoem 75 | Write OEM ID string to file system. 76 | .TP 77 | .B \-S , \-\-writewds 78 | Write Windows Disk Signature hexadecimal to MBR. 79 | .TP 80 | .B \-7, \-\-mbr7 81 | Write a Windows 7 master boot record to device. 82 | Does not change Windows Disk Signature (bytes 01b8-01bd). 83 | This MBR will boot certain partition types beyond cylinder 84 | 1024 using LBA addressing. 85 | .TP 86 | .B \-i, \-\-mbrvista 87 | Write a Windows Vista master boot record to device. 88 | Does not change Windows Disk Signature (bytes 01b8-01bd). 89 | This MBR will boot certain partition types beyond cylinder 90 | 1024 using LBA addressing. 91 | .TP 92 | .B \-m, \-\-mbr 93 | Write a Windows 2000/XP/2003 master boot record to device. 94 | Does not change Windows Disk Signature (bytes 01b8-01bd). 95 | This MBR will boot certain partition types beyond cylinder 96 | 1024 using LBA addressing. 97 | .TP 98 | .B \-9, \-\-mbr95b 99 | Write a Windows 95B/98/98SE/ME master boot record to device. 100 | Does not change Windows Disk Signature (bytes 01b8-01bd) or 101 | boot drive and time (bytes 00da-00df). 102 | This MBR will boot FAT-LBA partition types 0c and 0e beyond cylinder 103 | 1024 using LBA addressing. 104 | .TP 105 | .B \-d, \-\-mbrdos 106 | Write a DOS/Windows NT master boot record to device. 107 | Does not change Windows Disk Signature (bytes 01b8-01bd). 108 | This MBR will not boot beyond cylinder 1024 as it does not support 109 | LBA addressing. 110 | .TP 111 | .B \-s, \-\-mbrsyslinux 112 | Write a syslinux master boot record to device. 113 | Does not change Windows Disk Signature (bytes 01b8-01bd). 114 | This MBR will boot any partition types beyond cylinder 115 | 1024 using LBA addressing. 116 | .TP 117 | .B \-t, \-\-mbrgptsyslinux 118 | Write a GPL syslinux GPT MBR to device. 119 | This MBR will boot from a GPT partition table. 120 | .TP 121 | .B \-a, \-\-mbrreactos 122 | Write a ReactOS MBR to device. 123 | .TP 124 | .B \-k, \-\-mbrkolibrios 125 | Write a KolibriOS MBR to device. 126 | .TP 127 | .B \-r, \-\-mbrrufus 128 | Write a Rufus MBR to device. 129 | .TP 130 | .B \-g, \-\-mbrgrub4dos 131 | Write a Grub4Dos MBR to device. 132 | .TP 133 | .B \-b, \-\-mbrgrub2 134 | Write a Grub 2 MBR to device. 135 | .TP 136 | .B \-z, \-\-mbrzero 137 | Write an empty (zeroed, non-bootable) master boot record to device. 138 | Zeroes all bytes except the partition map and signature id (bytes 01be-01ff). 139 | Similar to the empty DOS partition table that fdisk creates. 140 | .TP 141 | .B \-f, \-\-force 142 | Force writing of boot record. 143 | .TP 144 | .B \-h, \-\-help 145 | Show summary of options. 146 | .TP 147 | .B \-v, \-\-version 148 | Show program version. 149 | .TP 150 | .B \-w, \-\-write 151 | Write automatically selected boot record to device. 152 | .P 153 | If ms-sys is started without any options a simple diagnosis will be done on 154 | the given device. 155 | .br 156 | .SH EXAMPLES 157 | .P 158 | Please note that Windows ME is not useful for making standalone bootable 159 | floppies. However, Win9x and DOS works fine with the first two examples. 160 | .P 161 | .B Creating a 1.68 MB bootable floppy 162 | .TP 163 | This example assumes that you have your windows installation mounted at /dosc and also have mtools and fdformat installed. 164 | .P 165 | fdformat /dev/fd0u1680 166 | .br 167 | mformat a: 168 | .br 169 | ms-sys -w /dev/fd0 170 | .br 171 | mcopy /dosc/io.sys a: 172 | .br 173 | mcopy /dosc/msdos.sys a: 174 | .br 175 | mcopy /dosc/command.com a: 176 | .P 177 | .B Creating a bootable 2.8 MB floppy image to use with an el-torito bootable CD 178 | .P 179 | dd if=/dev/zero of=floppy288.img bs=1024 count=2880 180 | .br 181 | /sbin/mkdosfs floppy288.img 182 | .br 183 | ms-sys -1 -f floppy288.img 184 | .br 185 | su 186 | .br 187 | mount -o loop floppy288.img /mnt 188 | .br 189 | cp msdos.sys /mnt/ 190 | .br 191 | cp io.sys /mnt/ 192 | .br 193 | cp command.com /mnt/ 194 | .br 195 | (it might also be a good idea to add a config.sys and autoexec.bat with CDROM support) 196 | .br 197 | umount /mnt 198 | .br 199 | exit 200 | .br 201 | cp floppy288.img cd-files/boot.img 202 | .br 203 | mkisofs -b boot.img -c boot.cat -o cdimage.iso cd\-files 204 | .br 205 | (burn the file cdimage.iso to a CD with cdrecord or another program) 206 | .P 207 | .B restoring a backup of Win9x or Win ME to a fresh hard disk 208 | .P 209 | Step 1, use GNU parted to create your FAT32 partition and file system: 210 | .P 211 | parted (then create partition and file system) 212 | .P 213 | Step 2, write the MBR: 214 | .P 215 | ms-sys -w /dev/hda 216 | .P 217 | Step 3, write the FAT32 partition boot record: 218 | .P 219 | ms-sys -w /dev/hda1 220 | .P 221 | Step 4, mount your new filesystem: 222 | .P 223 | mount /dev/hda1 /mnt 224 | .P 225 | Step 5, read your backup 226 | .P 227 | cd /mnt; tar -xzvf /path/to/my_windows_backup_file.tgz 228 | .br 229 | .SH ENVIRONMENT 230 | The variables LANG and LC_ALL have the usual meaning, however there are not 231 | many translations available. 232 | .br 233 | .SH BUGS 234 | There have been reports about unbootable FAT32 partitions created with 235 | "mformat -F c:". The problem has also been reported on partitions 236 | formatted with mkdosfs and mkfs.vfat. One workaround is to use gnu parted 237 | to create the partition instead. Since version 1.1.3 ms-sys has the switch 238 | \-p which is supposed to fix this problem. Unfortunately, when using ms-sys 239 | with Linux kernel 2.6 nor the \-p switch or gnu parted might work. A simple 240 | workaround is to use ms-sys with Linux kernel 2.4. Another possible workaround 241 | is to manually set the number of heads with the switch -H. If the system has 242 | been booted by LILO, the correct number of heads can be given by "lilo -T geom". 243 | .P 244 | The writing of NTFS partition boot records in ms-sys probably has no practical use. 245 | For Windows 7 it has been reported that doing "sysprep" before making an image of 246 | an NTFS partition will make the partition restored from the image bootable. 247 | .SH AUTHOR 248 | This manual page was originally written by G\[:u]rkan Seng\[:u]n and since 249 | edited by Henrik Carlqvist. The program ms-sys is mostly written by 250 | Henrik Carlqvist, the file CONTRIBUTORS in the source archive contains a 251 | complete list of contributors. 252 | .SH SEE ALSO 253 | mformat(1) fdformat(8) mkdosfs(8) mkisofs(8) parted(8) 254 | -------------------------------------------------------------------------------- /src/br.c: -------------------------------------------------------------------------------- 1 | /****************************************************************** 2 | Copyright (C) 2009-2015 Henrik Carlqvist 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation; either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 17 | ******************************************************************/ 18 | #include 19 | 20 | #include "file.h" 21 | #include "nls.h" 22 | #include "br.h" 23 | 24 | static unsigned long ulBytesPerSector = 512; 25 | 26 | void set_bytes_per_sector(unsigned long ulValue) 27 | { 28 | ulBytesPerSector = ulValue; 29 | if ((ulBytesPerSector < 512) || (ulBytesPerSector > 65536)) 30 | ulBytesPerSector = 512; 31 | } /* set_bytes_per_sector */ 32 | 33 | uint32_t read_windows_disk_signature(FILE *fp) 34 | { 35 | uint32_t tWDS; 36 | if(!read_data(fp, 0x1b8, &tWDS, 4)) 37 | return 0; 38 | return tWDS; 39 | } /* read_windows_disk_signature */ 40 | 41 | int write_windows_disk_signature(FILE *fp, uint32_t tWDS) 42 | { 43 | return write_data(fp, 0x1b8, &tWDS, 4); 44 | } /* write_windows_disk_signature */ 45 | 46 | uint16_t read_mbr_copy_protect_bytes(FILE *fp) 47 | { 48 | uint16_t tOut; 49 | if(!read_data(fp, 0x1bc, &tOut, 2)) 50 | return 0xffff; 51 | return tOut; 52 | } /* read_mbr_copy_protect_bytes */ 53 | 54 | const char *read_mbr_copy_protect_bytes_explained(FILE *fp) 55 | { 56 | uint16_t t = read_mbr_copy_protect_bytes(fp); 57 | switch(t) 58 | { 59 | case 0: 60 | return _("not copy protected"); 61 | case 0x5a5a: 62 | return _("copy protected"); 63 | default: 64 | return _("unknown value"); 65 | } 66 | } /* read_mbr_copy_protect_bytes_explained */ 67 | 68 | int is_br(FILE *fp) 69 | { 70 | /* A "file" is probably some kind of boot record if it contains the magic 71 | chars 0x55, 0xAA at position 0x1FE */ 72 | unsigned char aucRef[] = {0x55, 0xAA}; 73 | 74 | return contains_data(fp, 0x1FE, aucRef, sizeof(aucRef)); 75 | } /* is_br */ 76 | 77 | int is_lilo_br(FILE *fp) 78 | { 79 | /* A "file" is probably a LILO boot record if it contains the magic 80 | chars LILO at position 0x6 or 0x2 for floppies */ 81 | unsigned char aucRef[] = {'L','I','L','O'}; 82 | 83 | return ( contains_data(fp, 0x6, aucRef, sizeof(aucRef)) || 84 | contains_data(fp, 0x2, aucRef, sizeof(aucRef)) ); 85 | } /* is_lilo_br */ 86 | 87 | int is_dos_mbr(FILE *fp) 88 | { 89 | #include "mbr_dos.h" 90 | 91 | return 92 | contains_data(fp, 0x0, mbr_dos_0x0, sizeof(mbr_dos_0x0)) && 93 | is_br(fp); 94 | } /* is_dos_mbr */ 95 | 96 | int is_dos_f2_mbr(FILE *fp) 97 | { 98 | #include "mbr_dos_f2.h" 99 | 100 | return 101 | contains_data(fp, 0x0, mbr_dos_f2_0x0, sizeof(mbr_dos_f2_0x0)) && 102 | is_br(fp); 103 | } /* is_dos_f2_mbr */ 104 | 105 | int is_95b_mbr(FILE *fp) 106 | { 107 | #include "mbr_95b.h" 108 | 109 | return 110 | contains_data(fp, 0x0, mbr_95b_0x0, sizeof(mbr_95b_0x0)) && 111 | contains_data(fp, 0x0e0, mbr_95b_0x0e0, sizeof(mbr_95b_0x0e0)) && 112 | is_br(fp); 113 | } /* is_95b_mbr */ 114 | 115 | int is_2000_mbr(FILE *fp) 116 | { 117 | #include "mbr_2000.h" 118 | 119 | return 120 | contains_data(fp, 0x0, mbr_2000_0x0, sizeof(mbr_2000_0x0)) && 121 | is_br(fp); 122 | } /* is_2000_mbr */ 123 | 124 | int is_vista_mbr(FILE *fp) 125 | { 126 | #include "mbr_vista.h" 127 | 128 | return 129 | contains_data(fp, 0x0, mbr_vista_0x0, sizeof(mbr_vista_0x0)) && 130 | is_br(fp); 131 | } /* is_vista_mbr */ 132 | 133 | int is_win7_mbr(FILE *fp) 134 | { 135 | #include "mbr_win7.h" 136 | 137 | return 138 | contains_data(fp, 0x0, mbr_win7_0x0, sizeof(mbr_win7_0x0)) && 139 | is_br(fp); 140 | } /* is_win7_mbr */ 141 | 142 | int is_rufus_mbr(FILE *fp) 143 | { 144 | #include "mbr_rufus.h" 145 | 146 | return 147 | contains_data(fp, 0x0, mbr_rufus_0x0, sizeof(mbr_rufus_0x0)) && 148 | is_br(fp); 149 | } /* is_rufus_mbr */ 150 | 151 | int is_reactos_mbr(FILE *fp) 152 | { 153 | #include "mbr_reactos.h" 154 | 155 | return 156 | contains_data(fp, 0x0, mbr_reactos_0x0, sizeof(mbr_reactos_0x0)) && 157 | is_br(fp); 158 | } /* is_reactos_mbr */ 159 | 160 | int is_grub4dos_mbr(FILE *fp) 161 | { 162 | #include "mbr_grub.h" 163 | 164 | return 165 | contains_data(fp, 0x0, mbr_grub_0x0, sizeof(mbr_grub_0x0)) && 166 | is_br(fp); 167 | } /* is_grub_mbr */ 168 | 169 | int is_grub2_mbr(FILE *fp) 170 | { 171 | #include "mbr_grub2.h" 172 | 173 | return 174 | contains_data(fp, 0x0, mbr_grub2_0x0, sizeof(mbr_grub2_0x0)) && 175 | is_br(fp); 176 | } /* is_grub2_mbr */ 177 | 178 | int is_kolibrios_mbr(FILE *fp) 179 | { 180 | #include "mbr_kolibri.h" 181 | 182 | return 183 | contains_data(fp, 0x0, mbr_kolibri_0x0, sizeof(mbr_kolibri_0x0)) && 184 | is_br(fp); 185 | } /* is_kolibri_mbr */ 186 | 187 | int is_syslinux_mbr(FILE *fp) 188 | { 189 | #include "mbr_syslinux.h" 190 | 191 | return 192 | contains_data(fp, 0x0, mbr_syslinux_0x0, sizeof(mbr_syslinux_0x0)) && 193 | is_br(fp); 194 | } /* is_syslinux_mbr */ 195 | 196 | int is_syslinux_gpt_mbr(FILE *fp) 197 | { 198 | #include "mbr_gpt_syslinux.h" 199 | 200 | return 201 | contains_data(fp, 0x0, mbr_gpt_syslinux_0x0, 202 | sizeof(mbr_gpt_syslinux_0x0)) && 203 | is_br(fp); 204 | } /* is_syslinux_gpt_mbr */ 205 | 206 | int is_zero_mbr(FILE *fp) 207 | { 208 | #include "mbr_zero.h" 209 | 210 | return 211 | contains_data(fp, 0x0, mbr_zero_0x0, sizeof(mbr_zero_0x0)); 212 | /* Don't bother to check 55AA signature */ 213 | } /* is_zero_mbr */ 214 | 215 | int is_zero_mbr_not_including_disk_signature_or_copy_protect(FILE *fp) 216 | { 217 | #include "mbr_zero.h" 218 | 219 | return 220 | contains_data(fp, 0x0, mbr_zero_0x0, 0x1b8); 221 | } /* is_zero_mbr_not_including_disk_signature_or_copy_protect */ 222 | 223 | /* Handle nonstandard sector sizes (such as 4K) by writing 224 | the boot marker at every 512-2 bytes location */ 225 | static int write_bootmark(FILE *fp) 226 | { 227 | unsigned char aucRef[] = {0x55, 0xAA}; 228 | unsigned long pos = 0x1FE; 229 | 230 | for (pos = 0x1FE; pos < ulBytesPerSector; pos += 0x200) { 231 | if (!write_data(fp, pos, aucRef, sizeof(aucRef))) 232 | return 0; 233 | } 234 | return 1; 235 | } 236 | 237 | int write_dos_mbr(FILE *fp) 238 | { 239 | #include "mbr_dos.h" 240 | 241 | return 242 | write_data(fp, 0x0, mbr_dos_0x0, sizeof(mbr_dos_0x0)) && 243 | write_bootmark(fp); 244 | } /* write_dos_mbr */ 245 | 246 | int write_95b_mbr(FILE *fp) 247 | { 248 | #include "mbr_95b.h" 249 | 250 | return 251 | write_data(fp, 0x0, mbr_95b_0x0, sizeof(mbr_95b_0x0)) && 252 | write_data(fp, 0x0e0, mbr_95b_0x0e0, sizeof(mbr_95b_0x0e0)) && 253 | write_bootmark(fp); 254 | } /* write_95b_mbr */ 255 | 256 | int write_2000_mbr(FILE *fp) 257 | { 258 | #include "mbr_2000.h" 259 | 260 | return 261 | write_data(fp, 0x0, mbr_2000_0x0, sizeof(mbr_2000_0x0)) && 262 | write_bootmark(fp); 263 | } /* write_2000_mbr */ 264 | 265 | int write_vista_mbr(FILE *fp) 266 | { 267 | #include "mbr_vista.h" 268 | 269 | return 270 | write_data(fp, 0x0, mbr_vista_0x0, sizeof(mbr_vista_0x0)) && 271 | write_bootmark(fp); 272 | } /* write_vista_mbr */ 273 | 274 | int write_win7_mbr(FILE *fp) 275 | { 276 | #include "mbr_win7.h" 277 | 278 | return 279 | write_data(fp, 0x0, mbr_win7_0x0, sizeof(mbr_win7_0x0)) && 280 | write_bootmark(fp); 281 | } /* write_win7_mbr */ 282 | 283 | int write_rufus_mbr(FILE *fp) 284 | { 285 | #include "mbr_rufus.h" 286 | 287 | return 288 | write_data(fp, 0x0, mbr_rufus_0x0, sizeof(mbr_rufus_0x0)) && 289 | write_bootmark(fp); 290 | } /* write_rufus_mbr */ 291 | 292 | int write_reactos_mbr(FILE *fp) 293 | { 294 | #include "mbr_reactos.h" 295 | 296 | return 297 | write_data(fp, 0x0, mbr_reactos_0x0, sizeof(mbr_reactos_0x0)) && 298 | write_bootmark(fp); 299 | } /* write_reactos_mbr */ 300 | 301 | int write_kolibrios_mbr(FILE *fp) 302 | { 303 | #include "mbr_kolibri.h" 304 | 305 | return 306 | write_data(fp, 0x0, mbr_kolibri_0x0, sizeof(mbr_kolibri_0x0)) && 307 | write_bootmark(fp); 308 | } /* write_kolibri_mbr */ 309 | 310 | int write_syslinux_mbr(FILE *fp) 311 | { 312 | #include "mbr_syslinux.h" 313 | 314 | return 315 | write_data(fp, 0x0, mbr_syslinux_0x0, sizeof(mbr_syslinux_0x0)) && 316 | write_bootmark(fp); 317 | } /* write_syslinux_mbr */ 318 | 319 | int write_syslinux_gpt_mbr(FILE *fp) 320 | { 321 | #include "mbr_gpt_syslinux.h" 322 | 323 | return 324 | write_data(fp, 0x0, mbr_gpt_syslinux_0x0, sizeof(mbr_gpt_syslinux_0x0)) && 325 | write_bootmark(fp); 326 | } /* write_syslinux_gpt_mbr */ 327 | 328 | int write_grub4dos_mbr(FILE *fp) 329 | { 330 | #include "mbr_grub.h" 331 | 332 | return 333 | write_data(fp, 0x0, mbr_grub_0x0, sizeof(mbr_grub_0x0)) && 334 | write_bootmark(fp); 335 | } 336 | 337 | int write_grub2_mbr(FILE *fp) 338 | { 339 | #include "mbr_grub2.h" 340 | 341 | return 342 | write_data(fp, 0x0, mbr_grub2_0x0, sizeof(mbr_grub2_0x0)) && 343 | write_bootmark(fp); 344 | } 345 | 346 | int write_zero_mbr(FILE *fp) 347 | { 348 | #include "mbr_zero.h" 349 | 350 | return 351 | write_data(fp, 0x0, mbr_zero_0x0, sizeof(mbr_zero_0x0)) && 352 | write_bootmark(fp); 353 | } /* write_zero_mbr */ 354 | -------------------------------------------------------------------------------- /man/fr/ms-sys.1: -------------------------------------------------------------------------------- 1 | .\" Hey, EMACS: -*- nroff -Tutf8 -*- 2 | .\" First parameter, NAME, should be all caps 3 | .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection 4 | .\" other parameters are allowed: see man(7), man(1) 5 | .TH MS-SYS 1 "February 09, 2016" 6 | .\" Please adjust this date whenever revising the manpage. 7 | .\" 8 | .\" Some roff macros, for reference: 9 | .\" .nh disable hyphenation 10 | .\" .hy enable hyphenation 11 | .\" .ad l left justify 12 | .\" .ad b justify to both left and right margins 13 | .\" .nf disable filling 14 | .\" .fi enable filling 15 | .\" .br insert line break 16 | .\" .sp insert n+1 empty lines 17 | .\" for manpage-specific macros, see man(7) 18 | .SH NOM 19 | ms-sys \- \['e]crit des secteurs de d\['e]marrage de type Microsoft et autres 20 | .SH SYNOPSIS 21 | .B ms-sys 22 | .RI "[options] [p\['e]riph\['e]rique]" 23 | .SH DESCRIPTION 24 | \fBms-sys\fP sert \[`a] \['e]crire des secteurs de d\['e]marrage de type Microsoft, ou autres 25 | .SH OPTIONS 26 | La liste des options est donn\['e]e ci-dessous : 27 | .TP 28 | .B \-1, \-\-fat12 29 | \['E]crit un secteur de d\['e]marrage pour FAT12 de type disquette. 30 | .TP 31 | .B \-2, \-\-fat32nt 32 | \['E]crit un secteur de d\['e]marrage pour partition FAT32 de type NT. 33 | .TP 34 | .B \-e, \-\-fat32pe 35 | \['E]crit un secteur de d\['e]marrage pour partition FAT32 de type PE, pour installation USB. 36 | .TP 37 | .B \-3, \-\-fat32 38 | \['E]crit un secteur de d\['e]marrage pour partition FAT32 de type DOS (Win9x). 39 | .TP 40 | .B \-4, \-\-fat32free 41 | \['E]crit un secteur de d\['e]marrage pour partition FAT32 de type FreeDOS. 42 | .TP 43 | .B \-5, \-\-fat16free 44 | \['E]crit un secteur de d\['e]marrage pour partition FAT16 de type FreeDOS. 45 | .TP 46 | .B \-6, \-\-fat16 47 | \['E]crit un secteur de d\['e]marrage pour partition FAT16 de type DOS (Win9x). 48 | .TP 49 | .B \-n, \-\-ntfs 50 | \['E]crit un secteur de d\['e]marrage pour partition NTFS de type Windows 7. 51 | Cette fonctionnalit\['e] doit \[^e]tre consid\['e]r\['e]e comme exp\['e]rimentale 52 | et n'a probablement aucun int\['e]r\[^e]t pratique. 53 | .TP 54 | .B \-o, \-\-fat16ros 55 | \['E]crit un secteur de d\['e]marrage pour partition FAT16 de type ReactOS. 56 | .TP 57 | .B \-c, \-\-fat32ros 58 | \['E]crit un secteur de d\['e]marrage pour partition FAT32 de type ReactOS. 59 | .TP 60 | .B \-q, \-\-fat32kos 61 | \['E]crit un secteur de d\['e]marrage pour partition FAT32 de type KolibriOS. 62 | .TP 63 | .B \-l, \-\-wipelabel 64 | R\['e]initialise le label de partition disque du secteur de d\['e]marrage. 65 | .TP 66 | .B \-p, \-\-partition 67 | \['E]crit les infos de partition (secteurs cach\['e]s, nombre de t\[^e]tes et 68 | ID de disque) dans le secteur de d\['e]marrage. Cela peut \[^e]tre 69 | n\['e]cessaire pour certaines partitions, en fonction de l'application 70 | qui a \['e]t\['e] utilis\['e]e pour cr\['e]er le syst\[`e]me de fichiers. 71 | .TP 72 | .B \-H , \-\-heads 73 | Sp\['e]cifie le nombre de t\[^e]tes, lorsque l'option -p est utilis\['e]e 74 | .TP 75 | .B \-O , \-\-writeoem 76 | Applique l'ID OEM au syst\[`e]me de fichiers. 77 | .TP 78 | .B \-S , \-\-writewds 79 | \['E]crit la signature de disque Windows (hex) dans le MBR. 80 | .TP 81 | .B \-7, \-\-mbr7 82 | \['E]crit un Master Boot Record de type Windows 7. 83 | Cette op\['e]ration ne change pas la signature disque (octets 01b8-01bd). 84 | Ce MBR peut aussi d\['e]marrer certains types de partitions, au del\[`a] du 85 | cylindre 1024, en utilisant le mode d'adressage 'LBA'. 86 | .TP 87 | .B \-i, \-\-mbrvista 88 | \['E]crit un Master Boot Record de type Windows Vista. 89 | Cette op\['e]ration ne change pas la signature disque (octets 01b8-01bd). 90 | Ce MBR peut aussi d\['e]marrer certains types de partitions, au del\[`a] du 91 | cylindre 1024, en utilisant le mode d'adressage 'LBA'. 92 | .TP 93 | .B \-m, \-\-mbr 94 | \['E]crit un Master Boot Record de type Windows 2000/XP/2003. 95 | Cette op\['e]ration ne change pas la signature disque (octets 01b8-01bd). 96 | Ce MBR peut aussi d\['e]marrer certains types de partitions, au del\[`a] du 97 | cylindre 1024, en utilisant le mode d'adressage 'LBA'. 98 | .TP 99 | .B \-9, \-\-mbr95b 100 | \['E]crit un Master Boot Record de type Windows 95B/98/98SE/ME. 101 | Cette op\['e]ration ne change pas la Signature Disque (octets 01b8-01bd) 102 | ou le p\['e]riph\['e]rique et horodatage de d\['e]marrage (octets 00da-00df). 103 | Ce MBR peut d\['e]marrer des partitions FAT-LBA de types 0c et 0e au 104 | del\[`a] du cylindre 1024, en utilisant le mode d'adressage 'LBA'. 105 | .TP 106 | .B \-d, \-\-mbrdos 107 | \['E]crit un Master Boot Record de type DOS/Windows NT. 108 | Cette op\['e]ration ne change pas la signature disque (octets 01b8-01bd). 109 | Ce MBR ne peut pas d\['e]marrer au del\[`a] du cylindre 1024, car il ne 110 | supporte pas le mode d'adressage 'LBA'. 111 | .TP 112 | .B \-s, \-\-mbrsyslinux 113 | \['E]crit un Master Boot Record de type Syslinux. 114 | Cette op\['e]ration ne change pas la signature disque (octets 01b8-01bd). 115 | Ce MBR peut aussi d\['e]marrer certains types de partitions, au del\[`a] du 116 | cylindre 1024, en utilisant le mode d'adressage 'LBA'. 117 | .TP 118 | .B \-t, \-\-mbrgptsyslinux 119 | \['E]crit un bloc GPL Syslinux de type GPT MBR. 120 | Ce MBR d\['e]marre seulement un syst\[`e]me de partitions GPT. 121 | .TP 122 | .B \-a, \-\-mbrreactos 123 | \['E]crit un Master Boot Record de type ReactOS. 124 | .TP 125 | .B \-k, \-\-mbrkolibrios 126 | \['E]crit un Master Boot Record de type KolibriOS. 127 | .TP 128 | .B \-r, \-\-mbrrufus 129 | \['E]crit un Master Boot Record de type Rufus. 130 | .TP 131 | .B \-g, \-\-mbrgrub4dos 132 | \['E]crit un Master Boot Record de type Grub4DOS. 133 | .TP 134 | .B \-b, \-\-mbrgrub2 135 | \['E]crit un Master Boot Record de type GRUB 2. 136 | .TP 137 | .B \-z, \-\-mbrzero 138 | \['E]crit un Master Boot Record de type vide (z\['e]ro, non-d\['e]marrable). 139 | Tous les octets, en dehors de la table de partition et de la signature disque 140 | (octets 01be-01ff), sont mis a z\['e]ro. 141 | Similaire \[`a] la table de partition vide DOS cr\['e]\['e]e par fdisk. 142 | .TP 143 | .B \-f, \-\-force 144 | Force l'\['e]criture des secteurs de d\['e]marrage. 145 | .TP 146 | .B \-h, \-\-help 147 | Affiche un sommaire des options. 148 | .TP 149 | .B \-v, \-\-version 150 | Affiche la version du programme. 151 | .TP 152 | .B \-w, \-\-write 153 | \['E]crit les secteurs de d\['e]marrage automatiquement s\['e]lectionn\['e]s. 154 | .P 155 | Si ms-sys est d\['e]marr\['e] sans param\[`e]tres, un diagnostic sera effectu\['e] sur le 156 | p\['e]riph\['e]rique s\['e]lectionn\['e]. 157 | .br 158 | .SH EXEMPLES 159 | .P 160 | Notez que Windows ME est contre-indiqu\['e] pour cr\['e]er des disquettes d\['e]marrables. 161 | En revanche, Win9x et DOS marchent correctement pour les 2 premiers exemples. 162 | .P 163 | .B Cr\['e]ation d'une disquette 1.68 Mo d\['e]marrable 164 | .TP 165 | Cet exemple assume que votre installation de Windows est mont\['e]e sous /dos et que vous avez 'mtools' et 'fdformat' install\['e]s. 166 | .P 167 | fdformat /dev/fd0u1680 168 | .br 169 | mformat a: 170 | .br 171 | ms-sys -w /dev/fd0 172 | .br 173 | mcopy /dosc/io.sys a: 174 | .br 175 | mcopy /dosc/msdos.sys a: 176 | .br 177 | mcopy /dosc/command.com a: 178 | .P 179 | .B Cr\['e]ation d'une disquette 2.8 Mo d\['e]marrable, pour utilisation sur un CD d\['e]marrable El Torito 180 | .P 181 | dd if=/dev/zero of=floppy288.img bs=1024 count=2880 182 | .br 183 | /sbin/mkdosfs floppy288.img 184 | .br 185 | ms-sys -1 -f floppy288.img 186 | .br 187 | su 188 | .br 189 | mount -o loop floppy288.img /mnt 190 | .br 191 | cp msdos.sys /mnt/ 192 | .br 193 | cp io.sys /mnt/ 194 | .br 195 | cp command.com /mnt/ 196 | .br 197 | (Vous voudrez sans doute ajouter un 'config.sys' et 'autoexec.bat' avec support CD-ROM) 198 | .br 199 | umount /mnt 200 | .br 201 | exit 202 | .br 203 | cp floppy288.img cd-files/boot.img 204 | .br 205 | mkisofs -b boot.img -c boot.cat -o cdimage.iso cd\-files 206 | .br 207 | (vous pouvez maintenant graver 'cdimage.iso' sur un CD en utilisant cdrecord ou un autre programme) 208 | .P 209 | .B Restoration d'une copie de sauvegarde de Win9x ou Win ME sur un nouveau disque dur 210 | .P 211 | \['E]tape 1, utilisez GNU parted pour cr\['e]er votre partition et syst\[`e]me de fichiers FAT32 : 212 | .P 213 | parted (puis cr\['e]ez la partition et le syst\[`e]me de fichiers) 214 | .P 215 | \['E]tape 2, \['e]crivez le MBR : 216 | .P 217 | ms-sys -w /dev/hda 218 | .P 219 | \['E]tape 3, \['e]crivez les secteurs de d\['e]marrage sur la partition FAT32 : 220 | .P 221 | ms-sys -w /dev/hda1 222 | .P 223 | \['E]tape 4, montez votre nouveau syst\[`e]me de fichiers : 224 | .P 225 | mount /dev/hda1 /mnt 226 | .P 227 | \['E]tape 5, lisez votre copie de sauvegarde 228 | .P 229 | cd /mnt; tar -xzvf /path/to/my_windows_backup_file.tgz 230 | .br 231 | .SH ENVIRONEMENT 232 | Les variables LANG et LC_ALL ont leur utilisation habituelle. Peu de traductions 233 | sont toutefois disponibles... 234 | .br 235 | .SH BUGS 236 | Nous avons des rapports concernant des partitions FAT32 non-d\['e]marrables, cr\['e]\['e]es 237 | avec la commande 'mformat -F c:'. Ce probl\[`e]me nous \[`a] aussi \['e]t\['e] indiqu\['e] pour des 238 | partitions format\['e]es avec 'mkdosfs' et 'mkfs.vfat'. Une solution de contournement 239 | consiste \[`a] utiliser GNU parted pour cr\['e]er la partition. Depuis la version 1.1.3, 240 | ms-sys a aussi l'option \-p pour essayer d'\['e]liminer ce probl\[`e]me. 241 | Malheureusement, lorsque ms-sys est utilis\['e] avec un noyau Linux 2.6 ou plus 242 | r\['e]cent, l'utilisation de l'option \-p ou de GNU parted peut aussi se r\['e]v\['e]ler 243 | infructueuse. Une autre solution possible peut consister \[`a] indiquer le nombre 244 | de t\[^e]tes avec l'option \-H. Si votre syst\[`e]me a \['e]t\['e] d\['e]marr\['e] avec LILO, le 245 | nombre correct de t\[^e]tes peut \[^e]tre d\['e]termin\['e] par la commande "lilo -T geom". 246 | .P 247 | L'\['e]criture de secteurs de d\['e]marrage avec ms-sys sur une partition NTFS est 248 | vraisemblablement sans grand int\['e]r\[^e]t pratique. Pour Windows 7, nous avons des 249 | indications qu'effectuer un 'sysprep' avant de cr\['e]er une image d'une partition 250 | NTFS peut rendre cette partition d\['e]marrable apr\[`e]s restauration. 251 | .SH AUTEURS 252 | Cette page man a \['e]t\['e] traduite par Pete Batard. Le programme ms-sys est 253 | principalement \['e]crit par Henrik Carlqvist. Le fichier 'CONTRIBUTORS' dans 254 | l'archive source contient la liste compl\[`e]te des contributions. 255 | .SH VOYEZ AUSSI 256 | mformat(1) fdformat(8) mkdosfs(8) mkisofs(8) parted(8) 257 | -------------------------------------------------------------------------------- /man/de/ms-sys.1: -------------------------------------------------------------------------------- 1 | .\" Hey, EMACS: -*- nroff -*- 2 | .\" First parameter, NAME, should be all caps 3 | .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection 4 | .\" other parameters are allowed: see man(7), man(1) 5 | .TH MS-SYS 1 "December 26, 2015" 6 | .\" Please adjust this date whenever revising the manpage. 7 | .\" 8 | .\" Some roff macros, for reference: 9 | .\" .nh disable hyphenation 10 | .\" .hy enable hyphenation 11 | .\" .ad l left justify 12 | .\" .ad b justify to both left and right margins 13 | .\" .nf disable filling 14 | .\" .fi enable filling 15 | .\" .br insert line break 16 | .\" .sp insert n+1 empty lines 17 | .\" for manpage-specific macros, see man(7) 18 | .SH "BEZEICHNUNG" 19 | ms-sys \- schreibt einen Microsoft Bootblock 20 | .SH "\[:U]BERSICHT" 21 | .B ms-sys 22 | .RI "[Optionen] [Ger\[:a]t]" 23 | .SH "BESCHREIBUNG" 24 | \fBms-sys\fP ist f\[:u]r das Schreiben von Microsoft kompatiblen Bootrecords. 25 | .SH "OPTIONEN" 26 | Eine Zusammenfassung der Optionen ist unten aufgef\[:u]hrt. 27 | .TP 28 | .B \-1, \-\-fat12 29 | Schreibt einen FAT12 Disketten Bootrecord aufs Ger\[:a]t. 30 | .TP 31 | .B \-2, \-\-fat32nt 32 | Schreibt einen FAT32 Partition NT Bootrecord aufs Ger\[:a]t. 33 | .TP 34 | .B \-e, \-\-fat32pe 35 | Schreibt einen FAT32 Partition PE Bootrecord aufs Ger\[:a]t, 36 | f\[:u]r USB Installation und Wiederherstellung. 37 | .TP 38 | .B \-3, \-\-fat32 39 | Schreibt einen FAT32 Partition DOS (Win9x) Bootrecord aufs Ger\[:a]t, 40 | .TP 41 | .B \-4, \-\-fat32free 42 | Schreibt einen FAT32 Partition FreeDOS Bootrecord aufs Ger\[:a]t, 43 | .TP 44 | .B \-5, \-\-fat16free 45 | Schreibt einen FAT16 Partition Bootrecord aufs Ger\[:a]t, 46 | .TP 47 | .B \-6, \-\-fat16 48 | Schreibt einen FAT16 Partition DOS (Win9x) Bootrecord aufs Ger\[:a]t, 49 | .TP 50 | .B \-n, \-\-ntfs 51 | Schreibt einen NTFS Partition Windows 7 Bootrecord aufs Ger\[:a]t. 52 | Diese Funktionalit\[:a]t sollte als experimentell angesehen werden und 53 | ist wahrscheinlich von keinem praktischen Nutzen. 54 | .TP 55 | .B \-o, \-\-fat16ros 56 | Schreibt einen FAT16 Partition ReactOS Bootrecord aufs Ger\[:a]t. 57 | .TP 58 | .B \-c, \-\-fat32ros 59 | Schreibt einen FAT32 Partition ReactOS Bootrecord aufs Ger\[:a]t. 60 | .TP 61 | .B \-q, \-\-fat32kos 62 | Schreibt einen FAT32 Partition KolibriOS Bootrecord aufs Ger\[:a]t. 63 | .TP 64 | .B \-l, \-\-wipelabel 65 | Entfernt Volumenlabel im Bootrecord. 66 | .TP 67 | .B \-p, \-\-partition 68 | .\" wrong hyphenation Laufwerkskennung 69 | Schreibt Partitions-Info (versteckte Sektoren, K\[:o]pfe und 70 | Laufwerkskennung) in Bootrecord. 71 | Dies k\[:o]nnte auf einigen Partitionen erforderlich sein, je nach 72 | verwendetem Programm, mit dem das Dateisystem erstellt wurde. 73 | .TP 74 | .B \-H , \-\-heads 75 | Anzahl der K\[:o]pfe, wenn -p Option verwendet wird. 76 | .TP 77 | .B \-O , \-\-writeoem 78 | Schreibt OEM ID zum Dateisystem. 79 | .TP 80 | .B \-S , \-\-writewds 81 | Schreibt hexadezimal als Windows Platten-Signatur zum MBR. 82 | .TP 83 | .B \-7, \-\-mbr7 84 | Schreibt einen Windows 7 Master-Bootrecord aufs Ger\[:a]t. 85 | Dies \[:a]ndert die Windows Platten-Signatur nicht (Bytes 01b8-01bd). 86 | Dieser MBR wird bestimmte Partitionstypen jenseits der Zylindergrenze 87 | 1024 booten mittels LBA-Adressierung. 88 | .TP 89 | .B \-i, \-\-mbrvista 90 | Schreibt einen Windows Vista Master-Bootrecord aufs Ger\[:a]t. 91 | Dies \[:a]ndert die Windows Platten-Signatur nicht (Bytes 01b8-01bd). 92 | Dieser MBR wird bestimmte Partitionstypen jenseits der Zylindergrenze 93 | 1024 booten mittels LBA-Adressierung. 94 | .TP 95 | .B \-m, \-\-mbr 96 | Schreibt einen Windows 2000/XP/2003 Master-Bootrecord aufs Ger\[:a]t. 97 | Dies \[:a]ndert die Windows Platten-Signatur nicht (Bytes 01b8-01bd). 98 | Dieser MBR wird bestimmte Partitionstypen jenseits der Zylindergrenze 99 | 1024 booten mittels LBA-Adressierung. 100 | .TP 101 | .B \-9, \-\-mbr95b 102 | Schreibt einen Windows 95B/98/98SE/ME Master-Bootrecord aufs Ger\[:a]t. 103 | Dies \[:a]ndert weder die Windows Platten-Signatur (Bytes 01b8-01bd) noch 104 | das Boot-Laufwerk und die Zeit (Bytes 00da-00df). 105 | Dieser MBR wird Partitionstypen 0c and 0e jenseits der Zylindergrenze 106 | 1024 booten mittels LBA-Adressierung. 107 | .TP 108 | .B \-d, \-\-mbrdos 109 | Schreibt einen DOS/Windows NT Master-Bootrecord aufs Ger\[:a]t. 110 | Dies \[:a]ndert die Windows Platten-Signatur nicht (Bytes 01b8-01bd). 111 | Dieser MBR wird nicht jenseits der Zylindergrenze 1024 booten 112 | da er die LBA-Adressierung nicht unterst\[:u]tzt. 113 | .TP 114 | .B \-s, \-\-mbrsyslinux 115 | Schreibt einen Syslinux Master-Bootrecord aufs Ger\[:a]t. 116 | Dies \[:a]ndert die Windows Platten-Signatur nicht (Bytes 01b8-01bd). 117 | Dieser MBR wird jeden Partitionstypen jenseits der Zylindergrenze 118 | 1024 booten mittels LBA-Adressierung. 119 | .TP 120 | .B \-t, \-\-mbrgptsyslinux 121 | Schreibt einen GPL Syslinux GPT Master-Bootrecord aufs Ger\[:a]t. 122 | Dieser MBR wird booten von einer GUID-Partitionstabelle. 123 | .TP 124 | .B \-a, \-\-mbrreactos 125 | Schreibt einen ReactOS Master-Bootrecord aufs Ger\[:a]t. 126 | .TP 127 | .B \-k, \-\-mbrkolibrios 128 | Schreibt einen KolibriOS Master-Bootrecord aufs Ger\[:a]t. 129 | .TP 130 | .B \-r, \-\-mbrrufus 131 | Schreibt einen Rufus Master-Bootrecord aufs Ger\[:a]t. 132 | .TP 133 | .B \-g, \-\-mbrgrub4dos 134 | Schreibt einen Grub4Dos Master-Bootrecord aufs Ger\[:a]t. 135 | .TP 136 | .B \-b, \-\-mbrgrub2 137 | Schreibt einen Grub 2 Master-Bootrecord aufs Ger\[:a]t. 138 | .TP 139 | .B \-z, \-\-mbrzero 140 | Schreibt einen leeren (augenullten, nicht startbaren) Master-Bootrecord aufs Ger\[:a]t. 141 | Nullt alle Bytes mit Ausnahme der Partitionstabelle und 142 | der Signatur Id (Bytes 01BE-01FF). 143 | \[:A]hnlich wie ein leere DOS-Partitionstabelle, die fdisk erstellt. 144 | .TP 145 | .B \-f, \-\-force 146 | Schreiben des Bootrecords erzwingen. 147 | .TP 148 | .B \-h, \-\-help 149 | Zeigt Zusammenfassung der Optionen. 150 | .TP 151 | .B \-v, \-\-version 152 | Zeigt Programmversion. 153 | .TP 154 | .B \-w, \-\-write 155 | Schreibt automatisch gew\[:a]hlten Bootrecord aufs Ger\[:a]t. 156 | .P 157 | ms-sys ohne Optionen wird eine einfache Diagnose an 158 | dem angegebenen Ger\[:a]t durchf\[:u]hren. 159 | .br 160 | .SH "BEISPIELE" 161 | .P 162 | Bitte beachten Sie, dass Windows ME nicht sinnvoll f\[:u]r die Herstellung von 163 | eigenst\[:a]ndig bootf\[:a]higen Disketten ist. 164 | Win9x und DOS jedoch funktionieren gut mit den ersten beiden Beispielen. 165 | .P 166 | .B Erstellen einer bootf\[:a]higen 1,68 MB Diskette 167 | .TP 168 | Dieses Beispiel geht davon aus, dass Sie Ihre Windows-Installation in /dosc eingeh\[:a]ngt haben und 169 | auch mtools und fdformat installiert sind. 170 | .P 171 | fdformat /dev/fd0u1680 172 | .br 173 | mformat a: 174 | .br 175 | ms-sys -w /dev/fd0 176 | .br 177 | mcopy /dosc/io.sys a: 178 | .br 179 | mcopy /dosc/msdos.sys a: 180 | .br 181 | mcopy /dosc/command.com a: 182 | .P 183 | .B Erstellen eines bootf\[:a]higen 2.8 MB Disketten-Abbilds f\[:u]r eine El-Torito bootf\[:a]hige CD. 184 | .P 185 | dd if=/dev/zero of=floppy288.img bs=1024 count=2880 186 | .br 187 | /sbin/mkdosfs floppy288.img 188 | .br 189 | ms-sys -1 -f floppy288.img 190 | .br 191 | su 192 | .br 193 | mount -o loop floppy288.img /mnt 194 | .br 195 | cp msdos.sys /mnt/ 196 | .br 197 | cp io.sys /mnt/ 198 | .br 199 | cp command.com /mnt/ 200 | .br 201 | (es k\[:o]nnte auch eine gute Idee sein, eine config.sys und autoexec.bat mit CD-ROM-Unterst\[:u]tzung hinzuf\[:u]gen) 202 | .br 203 | umount /mnt 204 | .br 205 | exit 206 | .br 207 | cp floppy288.img cd-files/boot.img 208 | .br 209 | mkisofs -b boot.img -c boot.cat -o cdimage.iso cd\-files 210 | .br 211 | (Brennen Sie die Datei cdimage.iso auf CD mit cdrecord oder einem anderen Programm) 212 | .P 213 | .B Wiederherstellen einer Sicherung von Win9x oder Win ME auf einer neuen Festplatte 214 | .P 215 | Schritt 1, verwenden sie GNU parted um ihr FAT32-Partition und Dateisystem zu erstellen: 216 | .P 217 | parted (dann FAT32-Partition und Dateisystem erstellen) 218 | .P 219 | Schritt 2, schreiben des MBR: 220 | .P 221 | ms-sys -w /dev/hda 222 | .P 223 | Schritt 3, schreiben des FAT32 Partition Bootrecords: 224 | .P 225 | ms-sys -w /dev/hda1 226 | .P 227 | Schritt 4, einh\[:a]ngen des neuen Dateisystems: 228 | .P 229 | mount /dev/hda1 /mnt 230 | .P 231 | Schritt 5, Wiederherstellen ihres Backups 232 | .P 233 | cd /mnt; tar -xzvf /path/to/my_windows_backup_file.tgz 234 | .br 235 | .SH "UMGEBUNG" 236 | Die Variablen LANG und LC_ALL haben die \[:u]bliche Bedeutung, 237 | aber es sind nicht viele \[:U]bersetzungen vorhanden. 238 | .br 239 | .SH "FEHLER" 240 | Es gab Berichte \[:u]ber nicht mehr bootbare FAT32-Partitionen erstellt mit 241 | "mformat -F C:". Das Problem wurde auch auf f\[:u]r Partitionen gemeldet, 242 | die mit mkdosfs und mkfs.vfat formatiert wurden. Eine Abhilfe ist, 243 | statt dessen GNU parted zu verwenden um die Partition zu erstellen. 244 | Seit der Version 1.1.3 ms-sys hat den Schalter \-p, der dieses Problem beheben soll. 245 | Leider funktioniert mit Linux Kernel 2.6 weder die Option \-p noch GNU parted. 246 | Eine einfache Abhilfe ist, ms-sys mit Linux Kernel 2.4 zu verwenden. 247 | Eine andere m\[:o]gliche Problemumgehung ist es, die Anzahl der K\[:o]pfe mit dem Schalter -H manuell einzustellen. 248 | Wenn das System von LILO gebootet wurde, kann die korrekte Anzahl der K\[:o]pfe 249 | durch "lilo -T geom" ermittelt werden. 250 | .P 251 | Das Schreiben von NTFS Partition-Bootrecords hat wohl keinen praktischen Nutzen. 252 | F\[:u]r Windows 7 wurde berichtet, dass das Ausf\[:u]hren von "sysprep", 253 | bevor Sie ein Abbild einer NTFS-Partition erstellen, 254 | die aus diesem wiederhergestellte Partition bootf\[:a]hig macht. 255 | .SH "AUTOREN" 256 | .\" basiert auf englisher Manualseite MS-SYS Version 2.5.0 "September 25, 2005" 257 | Die englischsprachige Handbuchseite wurde urspr\[:u]nglich von G\[:u]rkan Seng\[:u]n geschrieben 258 | und dann von Henrik Carlqvist bearbeitet. Er hat gr\[:o]\[ss]tenteils das Programm ms-sys geschrieben, 259 | die Datei CONTRIBUTORS in dem Quellen-Archiv enth\[:a]lt eine 260 | komplette Liste der Mitwirkenden. 261 | .SH "SIEHE AUCH" 262 | mformat(1) fdformat(8) mkdosfs(8) mkisofs(8) parted(8) 263 | .\" .TH MS-SYS 1 "September 25, 2005" 264 | .\" 265 | .\" FOR EMACS 266 | .\" Local Variables: 267 | .\" coding: utf-8 268 | .\" ispell-local-dictionary: "german8" 269 | .\" eval:(make-local-variable 'compile-command) 270 | .\" eval:(setq compile-command (concat "echo "(buffer-file-name) )) 271 | .\" eval:(make-local-variable 'time-stamp-start) 272 | .\" eval:(setq time-stamp-start "^\.TH MS-SYS 1 \"") 273 | .\" eval:(make-local-variable 'time-stamp-format) 274 | .\" eval:(setq time-stamp-format "%:b %02d, %04y") 275 | .\" End: 276 | .\" 277 | -------------------------------------------------------------------------------- /src/fat32.c: -------------------------------------------------------------------------------- 1 | /****************************************************************** 2 | Copyright (C) 2009 Henrik Carlqvist 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation; either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 17 | ******************************************************************/ 18 | #include 19 | #include 20 | 21 | #include "file.h" 22 | #include "fat32.h" 23 | 24 | int is_fat_32_fs(FILE *fp) 25 | { 26 | char *szMagic = "FAT32 "; 27 | 28 | return contains_data(fp, 0x52, szMagic, strlen(szMagic)); 29 | } /* is_fat_32_fs */ 30 | 31 | int is_fat_32_br(FILE *fp) 32 | { 33 | /* A "file" is probably some kind of FAT32 boot record if it contains the 34 | magic chars 0x55, 0xAA at positions 0x1FE, 0x3FE and 0x5FE */ 35 | unsigned char aucRef[] = {0x55, 0xAA}; 36 | unsigned char aucMagic[] = {'M','S','W','I','N','4','.','1'}; 37 | int i; 38 | 39 | for(i=0 ; i<3 ; i++) 40 | if( ! contains_data(fp, 0x1FE + i*0x200, aucRef, sizeof(aucRef))) 41 | return 0; 42 | if( ! contains_data(fp, 0x03, aucMagic, sizeof(aucMagic))) 43 | return 0; 44 | return 1; 45 | } /* is_fat_32_br */ 46 | 47 | int entire_fat_32_br_matches(FILE *fp) 48 | { 49 | #include "br_fat32_0x0.h" 50 | #include "br_fat32_0x52.h" 51 | #include "br_fat32_0x3f0.h" 52 | 53 | return 54 | ( contains_data(fp, 0x0, br_fat32_0x0, sizeof(br_fat32_0x0)) && 55 | /* BIOS Parameter Block might differ between systems */ 56 | contains_data(fp, 0x52, br_fat32_0x52, sizeof(br_fat32_0x52)) && 57 | /* Cluster information might differ between systems */ 58 | contains_data(fp, 0x3f0, br_fat32_0x3f0, sizeof(br_fat32_0x3f0)) ); 59 | } /* entire_fat_32_br_matches */ 60 | 61 | int write_fat_32_br(FILE *fp, int bKeepLabel) 62 | { 63 | #include "label_11_char.h" 64 | #include "br_fat32_0x0.h" 65 | #include "br_fat32_0x52.h" 66 | #include "br_fat32_0x3f0.h" 67 | 68 | if(bKeepLabel) 69 | return 70 | ( write_data(fp, 0x0, br_fat32_0x0, sizeof(br_fat32_0x0)) && 71 | /* BIOS Parameter Block should not be overwritten */ 72 | write_data(fp, 0x52, br_fat32_0x52, sizeof(br_fat32_0x52)) && 73 | /* Cluster information is not overwritten, however, it would be OK 74 | to write 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff here. */ 75 | write_data(fp, 0x3f0, br_fat32_0x3f0, sizeof(br_fat32_0x3f0)) ); 76 | else 77 | return 78 | ( write_data(fp, 0x0, br_fat32_0x0, sizeof(br_fat32_0x0)) && 79 | /* BIOS Parameter Block should not be overwritten */ 80 | write_data(fp, 0x47, label_11_char, sizeof(label_11_char)) && 81 | write_data(fp, 0x52, br_fat32_0x52, sizeof(br_fat32_0x52)) && 82 | /* Cluster information is not overwritten, however, it would be OK 83 | to write 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff here. */ 84 | write_data(fp, 0x3f0, br_fat32_0x3f0, sizeof(br_fat32_0x3f0)) ); 85 | } /* write_fat_32_br */ 86 | 87 | int entire_fat_32_fd_br_matches(FILE *fp) 88 | { 89 | #include "br_fat32_0x0.h" 90 | #include "br_fat32fd_0x52.h" 91 | #include "br_fat32fd_0x3f0.h" 92 | 93 | return 94 | ( contains_data(fp, 0x0, br_fat32_0x0, sizeof(br_fat32_0x0)) && 95 | /* BIOS Parameter Block might differ between systems */ 96 | contains_data(fp, 0x52, br_fat32_0x52, sizeof(br_fat32_0x52)) && 97 | /* Cluster information might differ between systems */ 98 | contains_data(fp, 0x3f0, br_fat32_0x3f0, sizeof(br_fat32_0x3f0)) ); 99 | } /* entire_fat_32_fd_br_matches */ 100 | 101 | int write_fat_32_fd_br(FILE *fp, int bKeepLabel) 102 | { 103 | #include "label_11_char.h" 104 | #include "br_fat32_0x0.h" 105 | #include "br_fat32fd_0x52.h" 106 | #include "br_fat32fd_0x3f0.h" 107 | 108 | if(bKeepLabel) 109 | return 110 | ( write_data(fp, 0x0, br_fat32_0x0, sizeof(br_fat32_0x0)) && 111 | /* BIOS Parameter Block should not be overwritten */ 112 | write_data(fp, 0x52, br_fat32_0x52, sizeof(br_fat32_0x52)) && 113 | /* Cluster information is not overwritten, however, it would be OK 114 | to write 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff here. */ 115 | write_data(fp, 0x3f0, br_fat32_0x3f0, sizeof(br_fat32_0x3f0)) ); 116 | else 117 | return 118 | ( write_data(fp, 0x0, br_fat32_0x0, sizeof(br_fat32_0x0)) && 119 | /* BIOS Parameter Block should not be overwritten */ 120 | write_data(fp, 0x47, label_11_char, sizeof(label_11_char)) && 121 | write_data(fp, 0x52, br_fat32_0x52, sizeof(br_fat32_0x52)) && 122 | /* Cluster information is not overwritten, however, it would be OK 123 | to write 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff here. */ 124 | write_data(fp, 0x3f0, br_fat32_0x3f0, sizeof(br_fat32_0x3f0)) ); 125 | } /* write_fat_32_fd_br */ 126 | 127 | int entire_fat_32_nt_br_matches(FILE *fp) 128 | { 129 | #include "br_fat32_0x0.h" 130 | #include "br_fat32nt_0x52.h" 131 | #include "br_fat32nt_0x3f0.h" 132 | #include "br_fat32nt_0x1800.h" 133 | 134 | return 135 | ( contains_data(fp, 0x0, br_fat32_0x0, sizeof(br_fat32_0x0)) && 136 | /* BIOS Parameter Block might differ between systems */ 137 | contains_data(fp, 0x52, br_fat32nt_0x52, sizeof(br_fat32nt_0x52)) && 138 | /* Cluster information might differ between systems */ 139 | contains_data(fp, 0x3f0, br_fat32nt_0x3f0, sizeof(br_fat32nt_0x3f0)) && 140 | contains_data(fp, 0x1800, br_fat32nt_0x1800, sizeof(br_fat32nt_0x1800)) 141 | ); 142 | } /* entire_fat_32_nt_br_matches */ 143 | 144 | int write_fat_32_nt_br(FILE *fp, int bKeepLabel) 145 | { 146 | #include "label_11_char.h" 147 | #include "br_fat32_0x0.h" 148 | #include "br_fat32nt_0x52.h" 149 | #include "br_fat32nt_0x3f0.h" 150 | #include "br_fat32nt_0x1800.h" 151 | 152 | if(bKeepLabel) 153 | return 154 | ( write_data(fp, 0x0, br_fat32_0x0, sizeof(br_fat32_0x0)) && 155 | /* BIOS Parameter Block should not be overwritten */ 156 | write_data(fp, 0x52, br_fat32nt_0x52, sizeof(br_fat32nt_0x52)) && 157 | /* Cluster information is not overwritten, however, it would be OK 158 | to write 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff here. */ 159 | write_data(fp, 0x3f0, br_fat32nt_0x3f0, sizeof(br_fat32nt_0x3f0)) && 160 | write_data(fp, 0x1800, br_fat32nt_0x1800, sizeof(br_fat32nt_0x1800)) 161 | ); 162 | else 163 | return 164 | ( write_data(fp, 0x0, br_fat32_0x0, sizeof(br_fat32_0x0)) && 165 | /* BIOS Parameter Block should not be overwritten */ 166 | write_data(fp, 0x47, label_11_char, sizeof(label_11_char)) && 167 | write_data(fp, 0x52, br_fat32nt_0x52, sizeof(br_fat32nt_0x52)) && 168 | /* Cluster information is not overwritten, however, it would be OK 169 | to write 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff here. */ 170 | write_data(fp, 0x3f0, br_fat32nt_0x3f0, sizeof(br_fat32nt_0x3f0)) && 171 | write_data(fp, 0x1800, br_fat32nt_0x1800, sizeof(br_fat32nt_0x1800)) 172 | ); 173 | } /* write_fat_32_nt_br */ 174 | 175 | int entire_fat_32_pe_br_matches(FILE *fp) 176 | { 177 | #include "br_fat32_0x0.h" 178 | #include "br_fat32pe_0x52.h" 179 | #include "br_fat32pe_0x3f0.h" 180 | #include "br_fat32pe_0x1800.h" 181 | 182 | return 183 | ( contains_data(fp, 0x0, br_fat32_0x0, sizeof(br_fat32_0x0)) && 184 | /* BIOS Parameter Block might differ between systems */ 185 | contains_data(fp, 0x52, br_fat32pe_0x52, sizeof(br_fat32pe_0x52)) && 186 | /* Cluster information might differ between systems */ 187 | contains_data(fp, 0x3f0, br_fat32pe_0x3f0, sizeof(br_fat32pe_0x3f0)) && 188 | contains_data(fp, 0x1800, br_fat32pe_0x1800, sizeof(br_fat32pe_0x1800)) 189 | ); 190 | } /* entire_fat_32_nt_br_matches */ 191 | 192 | int write_fat_32_pe_br(FILE *fp, int bKeepLabel) 193 | { 194 | #include "label_11_char.h" 195 | #include "br_fat32_0x0.h" 196 | #include "br_fat32pe_0x52.h" 197 | #include "br_fat32pe_0x3f0.h" 198 | #include "br_fat32pe_0x1800.h" 199 | 200 | if(bKeepLabel) 201 | return 202 | ( write_data(fp, 0x0, br_fat32_0x0, sizeof(br_fat32_0x0)) && 203 | /* BIOS Parameter Block should not be overwritten */ 204 | write_data(fp, 0x52, br_fat32pe_0x52, sizeof(br_fat32pe_0x52)) && 205 | /* Cluster information is not overwritten, however, it would bo OK 206 | to write 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff here. */ 207 | write_data(fp, 0x3f0, br_fat32pe_0x3f0, sizeof(br_fat32pe_0x3f0)) && 208 | write_data(fp, 0x1800, br_fat32pe_0x1800, sizeof(br_fat32pe_0x1800)) 209 | ); 210 | else 211 | return 212 | ( write_data(fp, 0x0, br_fat32_0x0, sizeof(br_fat32_0x0)) && 213 | /* BIOS Parameter Block should not be overwritten */ 214 | write_data(fp, 0x47, label_11_char, sizeof(label_11_char)) && 215 | write_data(fp, 0x52, br_fat32pe_0x52, sizeof(br_fat32pe_0x52)) && 216 | /* Cluster information is not overwritten, however, it would bo OK 217 | to write 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff here. */ 218 | write_data(fp, 0x3f0, br_fat32pe_0x3f0, sizeof(br_fat32pe_0x3f0)) && 219 | write_data(fp, 0x1800, br_fat32pe_0x1800, sizeof(br_fat32pe_0x1800)) 220 | ); 221 | } /* write_fat_32_pe_br */ 222 | 223 | int entire_fat_32_ros_br_matches(FILE *fp) 224 | { 225 | #include "br_fat32_0x0.h" 226 | #include "br_fat32ros_0x52.h" 227 | #include "br_fat32ros_0x3f0.h" 228 | #include "br_fat32ros_0x1c00.h" 229 | 230 | return 231 | ( contains_data(fp, 0x0, br_fat32_0x0, sizeof(br_fat32_0x0)) && 232 | /* BIOS Parameter Block might differ between systems */ 233 | contains_data(fp, 0x52, br_fat32ros_0x52, sizeof(br_fat32ros_0x52)) && 234 | /* Cluster information might differ between systems */ 235 | contains_data(fp, 0x3f0, br_fat32ros_0x3f0, sizeof(br_fat32ros_0x3f0)) && 236 | contains_data(fp, 0x1c00, br_fat32ros_0x1c00, sizeof(br_fat32ros_0x1c00)) 237 | ); 238 | } /* entire_fat_32_ros_br_matches */ 239 | 240 | /* See http://doxygen.reactos.org/dc/d83/bootsup_8c_source.html#l01596 */ 241 | int write_fat_32_ros_br(FILE *fp, int bKeepLabel) 242 | { 243 | #include "label_11_char.h" 244 | #include "br_fat32_0x0.h" 245 | #include "br_fat32ros_0x52.h" 246 | #include "br_fat32ros_0x3f0.h" 247 | #include "br_fat32ros_0x1c00.h" 248 | 249 | if(bKeepLabel) 250 | return 251 | ( write_data(fp, 0x0, br_fat32_0x0, sizeof(br_fat32_0x0)) && 252 | /* BIOS Parameter Block should not be overwritten */ 253 | write_data(fp, 0x52, br_fat32ros_0x52, sizeof(br_fat32ros_0x52)) && 254 | /* Cluster information is not overwritten, however, it would be OK 255 | to write 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff here. */ 256 | write_data(fp, 0x3f0, br_fat32ros_0x3f0, sizeof(br_fat32ros_0x3f0)) && 257 | write_data(fp, 0x1c00, br_fat32ros_0x1c00, sizeof(br_fat32ros_0x1c00)) 258 | ); 259 | else 260 | return 261 | ( write_data(fp, 0x0, br_fat32_0x0, sizeof(br_fat32_0x0)) && 262 | /* BIOS Parameter Block should not be overwritten */ 263 | write_data(fp, 0x47, label_11_char, sizeof(label_11_char)) && 264 | write_data(fp, 0x52, br_fat32ros_0x52, sizeof(br_fat32ros_0x52)) && 265 | /* Cluster information is not overwritten, however, it would be OK 266 | to write 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff here. */ 267 | write_data(fp, 0x3f0, br_fat32ros_0x3f0, sizeof(br_fat32ros_0x3f0)) && 268 | write_data(fp, 0x1c00, br_fat32ros_0x1c00, sizeof(br_fat32ros_0x1c00)) 269 | ); 270 | } /* write_fat_32_ros_br */ 271 | 272 | int entire_fat_32_kos_br_matches(FILE *fp) 273 | { 274 | #include "br_fat32_0x0.h" 275 | #include "br_fat32kos_0x52.h" 276 | 277 | return 278 | ( contains_data(fp, 0x0, br_fat32_0x0, sizeof(br_fat32_0x0)) && 279 | contains_data(fp, 0x52, br_fat32kos_0x52, sizeof(br_fat32kos_0x52)) ); 280 | } /* entire_fat_32_kos_br_matches */ 281 | 282 | int write_fat_32_kos_br(FILE *fp, int bKeepLabel) 283 | { 284 | #include "label_11_char.h" 285 | #include "br_fat32_0x0.h" 286 | #include "br_fat32kos_0x52.h" 287 | 288 | if(bKeepLabel) 289 | return 290 | ( write_data(fp, 0x0, br_fat32_0x0, sizeof(br_fat32_0x0)) && 291 | write_data(fp, 0x52, br_fat32kos_0x52, sizeof(br_fat32kos_0x52)) ); 292 | else 293 | return 294 | ( write_data(fp, 0x0, br_fat32_0x0, sizeof(br_fat32_0x0)) && 295 | write_data(fp, 0x47, label_11_char, sizeof(label_11_char)) && 296 | write_data(fp, 0x52, br_fat32kos_0x52, sizeof(br_fat32kos_0x52)) ); 297 | } /* write_fat_32_kos_br */ 298 | --------------------------------------------------------------------------------