*
* Modifications distributed under the terms of the GNU General Public
* License (GPL) version 3 (GPLv3), or (at your option) any later version.
*
* Modifications distributed under the terms of the GNU General Public
* License (GPL) version 3 (GPLv3), or (at your option) any later version.
FindMem(Buffer, SECTOR_SIZE, "ISOLINUX", 8) >= 0) {
Volume->HasBootCode = TRUE;
Volume->OSIconName = L"linux";
FindMem(Buffer, SECTOR_SIZE, "ISOLINUX", 8) >= 0) {
Volume->HasBootCode = TRUE;
Volume->OSIconName = L"linux";
} else if (FindMem(Buffer, 512, "Geom\0Hard Disk\0Read\0 Error", 26) >= 0) { // GRUB
Volume->HasBootCode = TRUE;
Volume->OSIconName = L"grub,linux";
} else if (FindMem(Buffer, 512, "Geom\0Hard Disk\0Read\0 Error", 26) >= 0) { // GRUB
Volume->HasBootCode = TRUE;
Volume->OSIconName = L"grub,linux";
FindMem(Buffer, SECTOR_SIZE, "Starting the BTX loader", 23) >= 0) {
Volume->HasBootCode = TRUE;
Volume->OSIconName = L"freebsd";
FindMem(Buffer, SECTOR_SIZE, "Starting the BTX loader", 23) >= 0) {
Volume->HasBootCode = TRUE;
Volume->OSIconName = L"freebsd";
// If more differentiation needed, also search for
// "Invalid partition table" &/or "Missing boot loader".
// If more differentiation needed, also search for
// "Invalid partition table" &/or "Missing boot loader".
(FindMem(Buffer, SECTOR_SIZE, "I/O error loading boot loader", 29) >= 0)) {
Volume->HasBootCode = TRUE;
Volume->OSIconName = L"freebsd";
(FindMem(Buffer, SECTOR_SIZE, "I/O error loading boot loader", 29) >= 0)) {
Volume->HasBootCode = TRUE;
Volume->OSIconName = L"freebsd";
} else if (FindMem(Buffer, 512, "!Loading", 8) >= 0 ||
FindMem(Buffer, SECTOR_SIZE, "/cdboot\0/CDBOOT\0", 16) >= 0) {
Volume->HasBootCode = TRUE;
Volume->OSIconName = L"openbsd";
} else if (FindMem(Buffer, 512, "!Loading", 8) >= 0 ||
FindMem(Buffer, SECTOR_SIZE, "/cdboot\0/CDBOOT\0", 16) >= 0) {
Volume->HasBootCode = TRUE;
Volume->OSIconName = L"openbsd";
} else if (FindMem(Buffer, 512, "Not a bootxx image", 18) >= 0 ||
*((UINT32 *)(Buffer + 1028)) == 0x7886b6d1) {
Volume->HasBootCode = TRUE;
Volume->OSIconName = L"netbsd";
} else if (FindMem(Buffer, 512, "Not a bootxx image", 18) >= 0 ||
*((UINT32 *)(Buffer + 1028)) == 0x7886b6d1) {
Volume->HasBootCode = TRUE;
Volume->OSIconName = L"netbsd";
// Windows NT/200x/XP
} else if (FindMem(Buffer, SECTOR_SIZE, "NTLDR", 5) >= 0) {
Volume->HasBootCode = TRUE;
Volume->OSIconName = L"win";
// Windows NT/200x/XP
} else if (FindMem(Buffer, SECTOR_SIZE, "NTLDR", 5) >= 0) {
Volume->HasBootCode = TRUE;
Volume->OSIconName = L"win";
// Windows Vista/7/8
} else if (FindMem(Buffer, SECTOR_SIZE, "BOOTMGR", 7) >= 0) {
Volume->HasBootCode = TRUE;
Volume->OSIconName = L"win8,win";
// Windows Vista/7/8
} else if (FindMem(Buffer, SECTOR_SIZE, "BOOTMGR", 7) >= 0) {
Volume->HasBootCode = TRUE;
Volume->OSIconName = L"win8,win";
} else if (FindMem(Buffer, 512, "CPUBOOT SYS", 11) >= 0 ||
FindMem(Buffer, 512, "KERNEL SYS", 11) >= 0) {
Volume->HasBootCode = TRUE;
Volume->OSIconName = L"freedos";
} else if (FindMem(Buffer, 512, "CPUBOOT SYS", 11) >= 0 ||
FindMem(Buffer, 512, "KERNEL SYS", 11) >= 0) {
Volume->HasBootCode = TRUE;
Volume->OSIconName = L"freedos";
} else if (FindMem(Buffer, 512, "OS2LDR", 6) >= 0 ||
FindMem(Buffer, 512, "OS2BOOT", 7) >= 0) {
Volume->HasBootCode = TRUE;
Volume->OSIconName = L"ecomstation";
} else if (FindMem(Buffer, 512, "OS2LDR", 6) >= 0 ||
FindMem(Buffer, 512, "OS2BOOT", 7) >= 0) {
Volume->HasBootCode = TRUE;
Volume->OSIconName = L"ecomstation";
} else if (FindMem(Buffer, 512, "Be Boot Loader", 14) >= 0) {
Volume->HasBootCode = TRUE;
Volume->OSIconName = L"beos";
} else if (FindMem(Buffer, 512, "Be Boot Loader", 14) >= 0) {
Volume->HasBootCode = TRUE;
Volume->OSIconName = L"beos";
} else if (FindMem(Buffer, 512, "yT Boot Loader", 14) >= 0) {
Volume->HasBootCode = TRUE;
Volume->OSIconName = L"zeta,beos";
} else if (FindMem(Buffer, 512, "yT Boot Loader", 14) >= 0) {
Volume->HasBootCode = TRUE;
Volume->OSIconName = L"zeta,beos";
} else if (FindMem(Buffer, 512, "\x04" "beos\x06" "system\x05" "zbeos", 18) >= 0 ||
FindMem(Buffer, 512, "\x06" "system\x0c" "haiku_loader", 20) >= 0) {
Volume->HasBootCode = TRUE;
Volume->OSIconName = L"haiku,beos";
} else if (FindMem(Buffer, 512, "\x04" "beos\x06" "system\x05" "zbeos", 18) >= 0 ||
FindMem(Buffer, 512, "\x06" "system\x0c" "haiku_loader", 20) >= 0) {
Volume->HasBootCode = TRUE;
Volume->OSIconName = L"haiku,beos";