26#define _FILE_OFFSET_BITS 64
40#ifdef REACTOS_ISOHYBRID_EFI_MAC_SUPPORT
52#ifdef REACTOS_ISOHYBRID_EFI_MAC_SUPPORT
53uuid_t disk_uuid, part_uuid, iso_uuid;
89#ifdef REACTOS_ISOHYBRID_EFI_MAC_SUPPORT
90uint8_t afp_header[] = { 0x45, 0x52, 0x08, 0x00, 0x00, 0x00, 0x90, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
92uuid_t efi_system_partition = {0xC1, 0x2A, 0x73, 0x28, 0xF8, 0x1F, 0x11, 0xD2, 0xBA, 0x4B, 0x00, 0xA0, 0xC9, 0x3E, 0xC9, 0x3B};
93uuid_t basic_partition = {0xEB,0xD0,0xA0,0xA2,0xB9,0xE5,0x44,0x33,0x87,0xC0,0x68,0xB6,0xB7,0x26,0x99,0xC7};
94uuid_t hfs_partition = {0x48, 0x46, 0x53, 0x00, 0x00, 0x00, 0x11, 0xAA, 0xAA, 0x11, 0x00, 0x30, 0x65, 0x43, 0xEC, 0xAC};
99 0, 0x77073096, 0xEE0E612C, 0x990951BA,
100 0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3,
101 0x0EDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988,
102 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91,
103 0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE,
104 0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7,
105 0x136C9856, 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC,
106 0x14015C4F, 0x63066CD9, 0xFA0F3D63, 0x8D080DF5,
107 0x3B6E20C8, 0x4C69105E, 0xD56041E4, 0xA2677172,
108 0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B,
109 0x35B5A8FA, 0x42B2986C, 0xDBBBC9D6, 0xACBCF940,
110 0x32D86CE3, 0x45DF5C75, 0xDCD60DCF, 0xABD13D59,
111 0x26D930AC, 0x51DE003A, 0xC8D75180, 0xBFD06116,
112 0x21B4F4B5, 0x56B3C423, 0xCFBA9599, 0xB8BDA50F,
113 0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924,
114 0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D,
115 0x76DC4190, 0x01DB7106, 0x98D220BC, 0xEFD5102A,
116 0x71B18589, 0x06B6B51F, 0x9FBFE4A5, 0xE8B8D433,
117 0x7807C9A2, 0x0F00F934, 0x9609A88E, 0xE10E9818,
118 0x7F6A0DBB, 0x086D3D2D, 0x91646C97, 0xE6635C01,
119 0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E,
120 0x6C0695ED, 0x1B01A57B, 0x8208F4C1, 0xF50FC457,
121 0x65B0D9C6, 0x12B7E950, 0x8BBEB8EA, 0xFCB9887C,
122 0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, 0xFBD44C65,
123 0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2,
124 0x4ADFA541, 0x3DD895D7, 0xA4D1C46D, 0xD3D6F4FB,
125 0x4369E96A, 0x346ED9FC, 0xAD678846, 0xDA60B8D0,
126 0x44042D73, 0x33031DE5, 0xAA0A4C5F, 0xDD0D7CC9,
127 0x5005713C, 0x270241AA, 0xBE0B1010, 0xC90C2086,
128 0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F,
129 0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4,
130 0x59B33D17, 0x2EB40D81, 0xB7BD5C3B, 0xC0BA6CAD,
131 0xEDB88320, 0x9ABFB3B6, 0x03B6E20C, 0x74B1D29A,
132 0xEAD54739, 0x9DD277AF, 0x04DB2615, 0x73DC1683,
133 0xE3630B12, 0x94643B84, 0x0D6D6A3E, 0x7A6A5AA8,
134 0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1,
135 0xF00F9344, 0x8708A3D2, 0x1E01F268, 0x6906C2FE,
136 0xF762575D, 0x806567CB, 0x196C3671, 0x6E6B06E7,
137 0xFED41B76, 0x89D32BE0, 0x10DA7A5A, 0x67DD4ACC,
138 0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5,
139 0xD6D6A3E8, 0xA1D1937E, 0x38D8C2C4, 0x4FDFF252,
140 0xD1BB67F1, 0xA6BC5767, 0x3FB506DD, 0x48B2364B,
141 0xD80D2BDA, 0xAF0A1B4C, 0x36034AF6, 0x41047A60,
142 0xDF60EFC3, 0xA867DF55, 0x316E8EEF, 0x4669BE79,
143 0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236,
144 0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F,
145 0xC5BA3BBE, 0xB2BD0B28, 0x2BB45A92, 0x5CB36A04,
146 0xC2D7FFA7, 0xB5D0CF31, 0x2CD99E8B, 0x5BDEAE1D,
147 0x9B64C2B0, 0xEC63F226, 0x756AA39C, 0x026D930A,
148 0x9C0906A9, 0xEB0E363F, 0x72076785, 0x05005713,
149 0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38,
150 0x92D28E9B, 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21,
151 0x86D3D2D4, 0xF1D4E242, 0x68DDB3F8, 0x1FDA836E,
152 0x81BE16CD, 0xF6B9265B, 0x6FB077E1, 0x18B74777,
153 0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C,
154 0x8F659EFF, 0xF862AE69, 0x616BFFD3, 0x166CCF45,
155 0xA00AE278, 0xD70DD2EE, 0x4E048354, 0x3903B3C2,
156 0xA7672661, 0xD06016F7, 0x4969474D, 0x3E6E77DB,
157 0xAED16A4A, 0xD9D65ADC, 0x40DF0B66, 0x37D83BF0,
158 0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9,
159 0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6,
160 0xBAD03605, 0xCDD70693, 0x54DE5729, 0x23D967BF,
161 0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94,
162 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D
172#ifdef REACTOS_ISOHYBRID_EFI_MAC_SUPPORT
191struct gpt_part_header {
200#define APM_OFFSET 2048
202struct apple_part_header {
230 printf(
"Usage: %s [OPTIONS] <boot.iso>\n",
prog);
237#define FMT "%-20s %s\n"
243 printf(
FMT,
" -h <X>",
"Number of geometry heads (default 64)");
244 printf(
FMT,
" -s <X>",
"Number of geometry sectors (default 32)");
245 printf(
FMT,
" -e --entry",
"Specify partition entry number (1-4)");
246 printf(
FMT,
" -o --offset",
"Specify partition offset (default 0)");
247 printf(
FMT,
" -t --type",
"Specify partition type (default 0x17)");
248 printf(
FMT,
" -i --id",
"Specify MBR ID (default random)");
249#ifdef REACTOS_ISOHYBRID_EFI_MAC_SUPPORT
250 printf(
FMT,
" -u --uefi",
"Build EFI bootable image");
251 printf(
FMT,
" -m --mac",
"Add AFP table support");
253 printf(
FMT,
" -b --mbr <PATH>",
"Load MBR from PATH");
256 printf(
FMT,
" --forcehd0",
"Assume we are loaded as disk ID 0");
257 printf(
FMT,
" --ctrlhd0",
"Assume disk ID 0 if the Ctrl key is pressed");
258 printf(
FMT,
" --partok",
"Allow booting from within a partition");
261 printf(
FMT,
" -? --help",
"Display this help");
262 printf(
FMT,
" -v --verbose",
"Display verbose output");
263 printf(
FMT,
" -V --version",
"Display version information");
266 printf(
"Report bugs to <pj.pandit@yahoo.co.in>\n");
276 const char optstr[] =
":h:s:e:o:t:i:b:umfcp?vV";
287#ifdef REACTOS_ISOHYBRID_EFI_MAC_SUPPORT
307 if (head < 1 || head > 256)
308 errx(1,
"invalid head: `%s', 1 <= head <= 256",
optarg);
313 if (sector < 1 || sector > 63)
314 errx(1,
"invalid sector: `%s', 1 <= sector <= 63",
optarg);
319 if (entry < 1 || entry > 4)
320 errx(1,
"invalid entry: `%s', 1 <= entry <= 4",
optarg);
322 errx(1,
"setting an entry is unsupported with EFI or Mac");
328 errx(1,
"invalid offset: `%s', 0 <= offset <= 64",
optarg);
334 errx(1,
"invalid type: `%s', 0 <= type <= 255",
optarg);
355#ifdef REACTOS_ISOHYBRID_EFI_MAC_SUPPORT
359 errx(1,
"setting an entry is unsupported with EFI or Mac");
365 errx(1,
"setting an entry is unsupported with EFI or Mac");
371 errx(1,
"--mbr : Path too long");
384 errx(1,
"option `-%c' takes an argument",
optopt);
389 errx(1,
"invalid option `-%c', see --help",
optopt);
407 r = (
s & 0x00FF) << 8 | (
s & 0xFF00) >> 8;
421 r = (
s & 0x000000FF) << 24 | (
s & 0xFF000000) >> 24
422 | (
s & 0x0000FF00) << 8 | (
s & 0x00FF0000) >> 8;
435 r = (
s & 0x00FF) << 8 | (
s & 0xFF00) >> 8;
449 r = (
s & 0x000000FF) << 24 | (
s & 0xFF000000) >> 24
450 | (
s & 0x0000FF00) << 8 | (
s & 0x00FF0000) >> 8;
463 r = (
s & 0x00000000000000FFull) << 56 | (
s & 0xFF00000000000000ull) >> 56
464 | (
s & 0x000000000000FF00ull) << 40 | (
s & 0x00FF000000000000ull) >> 40
465 | (
s & 0x0000000000FF0000ull) << 24 | (
s & 0x0000FF0000000000ull) >> 24
466 | (
s & 0x00000000FF000000ull) << 8 | (
s & 0x000000FF00000000ull) >> 8;
475 static const char banner[] =
"\0CD001\1EL TORITO SPECIFICATION\0\0\0\0" \
476 "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" \
482 buf +=
sizeof(banner) - 1;
496 for (
i = 0,
cs = 0;
i < 16;
i++)
509 if ((
ve[0] != 0x0001) || (
ve[15] != 0xAA55) || (
cs & 0xFFFF))
549#ifdef REACTOS_ISOHYBRID_EFI_MAC_SUPPORT
553 unsigned char header_indicator;
554 unsigned char platform_id;
564 if (platform_id == 0xef)
610 err(1,
"could not open MBR template file `%s'",
path);
614 err(1,
"error while reading MBR template file `%s'",
path);
625 uint8_t bhead = 0, bsect = 0, bcyle = 0;
626 uint8_t ehead = 0, esect = 0, ecyle = 0;
628#ifndef ISOHYBRID_C_STANDALONE
629 extern unsigned char isohdpfx[][
MBRSIZE];
636#ifdef ISOHYBRID_C_STANDALONE
638 err(1,
"This is a standalone binary. You must specify --mbr. E.g with /usr/lib/syslinux/isohdpfx.bin");
648#ifdef REACTOS_ISOHYBRID_EFI_MAC_SUPPORT
650 memcpy(mbr, afp_header,
sizeof(afp_header));
657#ifdef REACTOS_ISOHYBRID_EFI_MAC_SUPPORT
665 memcpy(mbr, &tmp,
sizeof(tmp));
669 memcpy(mbr, &tmp,
sizeof(tmp));
673 memcpy(mbr, &tmp,
sizeof(tmp));
687 bsect += (bcyle & 0x300) >> 2;
691 esect =
sector + (((
cc - 1) & 0x300) >> 2);
692 ecyle = (
cc - 1) & 0xFF;
694 for (
i = 1;
i <= 4;
i++)
709 memcpy(&mbr[8], &tmp,
sizeof(tmp));
712 memcpy(&mbr[12], &tmp,
sizeof(tmp));
714#ifdef REACTOS_ISOHYBRID_EFI_MAC_SUPPORT
727 memcpy(&mbr[8], &tmp,
sizeof(tmp));
730 memcpy(&mbr[12], &tmp,
sizeof(tmp));
744 memcpy(&mbr[8], &tmp,
sizeof(tmp));
747 memcpy(&mbr[12], &tmp,
sizeof(tmp));
763 unsigned int i = 0,
j = 0;
790 register unsigned long crc;
796 crc = ((crc >> 8) & 0x00FFFFFF) ^
crc_tab[(crc ^ *
block++) & 0xFF];
798 return (crc ^ 0xFFFFFFFF);
801#ifdef REACTOS_ISOHYBRID_EFI_MAC_SUPPORT
807 t =
p[0];
p[0] =
p[3];
p[3] =
t;
808 t =
p[1];
p[1] =
p[2];
p[2] =
t;
809 t =
p[4];
p[4] =
p[5];
p[5] =
t;
810 t =
p[6];
p[6] =
p[7];
p[7] =
t;
829#ifdef REACTOS_ISOHYBRID_EFI_MAC_SUPPORT
833 struct gpt_header *
header = (
struct gpt_header *)gpt;
834 struct gpt_part_header *part;
836 int gptsize = 128 / 4 + 2;
845 reverse_uuid(disk_uuid);
865 gpt +=
sizeof(
struct gpt_header) + hole * 512;
867 gpt -=
header->sizeOfPartitionEntries *
header->numParts;
869 part = (
struct gpt_part_header *)gpt;
873 reverse_uuid(part_uuid);
874 reverse_uuid(iso_uuid);
878 memcpy(part->partTypeGUID, basic_partition,
sizeof(
uuid_t));
883 gpt +=
sizeof(
struct gpt_part_header);
887 memcpy(part->partTypeGUID, basic_partition,
sizeof(
uuid_t));
892 gpt +=
sizeof(
struct gpt_part_header);
895 gpt +=
sizeof(
struct gpt_part_header);
900 memcpy(part->partTypeGUID, hfs_partition,
sizeof(
uuid_t));
920 struct apple_part_header *part = (
struct apple_part_header *)gpt;
926 strcpy(part->name,
"Apple");
927 strcpy(part->type,
"Apple_partition_map");
932 part = (
struct apple_part_header *)(gpt + 2048);
938 strcpy(part->name,
"EFI");
939 strcpy(part->type,
"Apple_HFS");
944 part = (
struct apple_part_header *)(gpt + 4096);
952 strcpy(part->name,
"EFI");
953 strcpy(part->type,
"Apple_HFS");
962 strcpy(part->name,
"ISO");
963 strcpy(part->type,
"Apple_Free");
977 int cylsize = 0,
frac = 0;
979#ifdef REACTOS_ISOHYBRID_EFI_MAC_SUPPORT
980 size_t orig_gpt_size, free_space, gpt_size;
995#ifdef REACTOS_ISOHYBRID_EFI_MAC_SUPPORT
997 errx(1,
"%s: --offset is invalid with UEFI images\n",
argv[0]);
1003 err(1,
"could not open file `%s'",
argv[0]);
1006 err(1,
"%s: seek error - 0",
argv[0]);
1009 err(1,
"%s: read error - 0",
argv[0]);
1012 err(1,
"%s: seek error - 1",
argv[0]);
1019 errx(1,
"%s: could not find boot record",
argv[0]);
1025 err(1,
"%s: seek error - 2",
argv[0]);
1033 errx(1,
"%s: invalid boot catalogue",
argv[0]);
1037 errx(1,
"%s: unexpected boot catalogue parameters",
argv[0]);
1044#ifdef REACTOS_ISOHYBRID_EFI_MAC_SUPPORT
1047 if (!read_efi_section(
buf)) {
1052 errx(1,
"%s: invalid efi catalogue",
argv[0]);
1055 errx(1,
"%s: unable to find efi image",
argv[0]);
1062#ifdef REACTOS_ISOHYBRID_EFI_MAC_SUPPORT
1065 if (!read_efi_section(
buf)) {
1070 errx(1,
"%s: invalid efi catalogue",
argv[0]);
1073 errx(1,
"%s: unable to find mac efi image",
argv[0]);
1079 err(1,
"%s: seek error - 3",
argv[0]);
1083 if (
fread(
buf,
sizeof(
char), 4, fp) != 4)
1087 errx(1,
"%s: boot loader does not have an isolinux.bin hybrid " \
1088 "signature. Note that isolinux-debug.bin does not support " \
1089 "hybrid booting",
argv[0]);
1095#ifdef REACTOS_ISOHYBRID_EFI_MAC_SUPPORT
1109 warnx(
"Warning: more than 1024 cylinders: %d",
c);
1110 warnx(
"Not all BIOSes will be able to boot this device");
1117 err(1,
"%s: seek error - 4",
argv[0]);
1119 if (
fread(&
id, 1, 4, fp) != 4)
1120 err(1,
"%s: read error",
argv[0]);
1141 err(1,
"%s: seek error - 5",
argv[0]);
1143 if (
fwrite(
buf,
sizeof(
char), mbr_size, fp) != mbr_size)
1144 err(1,
"%s: write error - 1",
argv[0]);
1146#ifdef REACTOS_ISOHYBRID_EFI_MAC_SUPPORT
1148 reverse_uuid(basic_partition);
1149 reverse_uuid(hfs_partition);
1152 orig_gpt_size = gpt_size = 512 + (128 * 128);
1156 gpt_size += (4 * 2048);
1166 if (free_space < orig_gpt_size &&
padding < orig_gpt_size) {
1183 err(1,
"%s: seek error - 6",
argv[0]);
1185 if (
fwrite(
buf,
sizeof(
char), gpt_size, fp) != gpt_size)
1186 err(1,
"%s: write error - 2",
argv[0]);
1197 initialise_apm(
buf, APM_OFFSET);
1200 fwrite(
buf,
sizeof(
char), apm_size, fp);
1207 err(1,
"%s: could not synchronise",
argv[0]);
1210 err(1,
"%s: could not add padding bytes",
argv[0]);
1213#ifdef REACTOS_ISOHYBRID_EFI_MAC_SUPPORT
1218 buf += orig_gpt_size -
sizeof(
struct gpt_header);
1223 buf -= 128 *
sizeof(
struct gpt_part_header);
1231 err(1,
"%s: seek error - 8",
argv[0]);
1233 if (
fwrite(
buf,
sizeof(
char), orig_gpt_size, fp) != orig_gpt_size)
1234 err(1,
"%s: write error - 4",
argv[0]);
void uuid_generate(__u8 *uuid)
UINT32 strtoul(const char *String, char **Terminator, UINT32 Base)
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
ACPI_SIZE strlen(const char *String)
char * strcpy(char *DstString, const char *SrcString)
unsigned short int uint16_t
#define required_argument
int getopt_long_only(optarg_ctx *o, int argc, WCHAR *const *argv, const WCHAR *shortopts, const struct option *longopts, int *longind)
GLuint GLuint GLsizei GLenum type
GLuint GLuint GLsizei count
GLdouble GLdouble GLdouble r
GLenum GLuint GLenum GLsizei const GLchar * buf
GLuint GLsizei GLsizei * length
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
_Check_return_ _CRTIMP int __cdecl ferror(_In_ FILE *_File)
_Check_return_opt_ _CRTIMP size_t __cdecl fread(_Out_writes_bytes_(_ElementSize *_Count) void *_DstBuf, _In_ size_t _ElementSize, _In_ size_t _Count, _Inout_ FILE *_File)
_Check_return_ _CRTIMP FILE *__cdecl fopen(_In_z_ const char *_Filename, _In_z_ const char *_Mode)
_Check_return_opt_ _CRTIMP int __cdecl fclose(_Inout_ FILE *_File)
_Check_return_opt_ _CRTIMP size_t __cdecl fwrite(_In_reads_bytes_(_Size *_Count) const void *_Str, _In_ size_t _Size, _In_ size_t _Count, _Inout_ FILE *_File)
_CRTIMP void __cdecl clearerr(_Inout_ FILE *_File)
void __cdecl srand(_In_ unsigned int _Seed)
_Check_return_ int __cdecl rand(void)
int ftruncate(int, off_t)
void read_mbr_template(char *path, uint8_t *mbr)
int check_catalogue(const uint8_t *buf)
uint32_t lendian_int(const uint32_t s)
uint16_t bendian_short(const uint16_t s)
uint32_t bendian_int(const uint32_t s)
int read_catalogue(const uint8_t *buf)
void display_catalogue(void)
size_t initialise_mbr(uint8_t *mbr)
uint32_t chksum_crc32(unsigned char *block, unsigned int length)
uint64_t lendian_64(const uint64_t s)
void display_mbr(const uint8_t *mbr, size_t len)
int check_banner(const uint8_t *buf)
char mbr_template_path[1024]
static uint16_t * ascii_to_utf16le(uint16_t *dst, const char *src)
uint16_t lendian_short(const uint16_t s)
int check_option(int argc, char *argv[])
#define memcpy(s1, s2, n)
struct task_struct * current
static unsigned int block