diff --git a/res/loc/ChangeLog.txt b/res/loc/ChangeLog.txt index 13881ac5..d7516e8b 100644 --- a/res/loc/ChangeLog.txt +++ b/res/loc/ChangeLog.txt @@ -23,6 +23,7 @@ o v3.* - *NEW* MSG_317 "Disk ID" // The following can be tested with -<+> and -<-> - *NEW* MSG_318 "Default thread priority: %d" + - *NEW* MSG_319 "Ignore Boot Marker" o v3.5 (2019.03.12) The following 3 messages can be tested by creating a UEFI:NTFS drive in Rufus ('Show advanced drive properties' must be enabled diff --git a/res/loc/rufus.loc b/res/loc/rufus.loc index 57218f53..bfb85246 100644 --- a/res/loc/rufus.loc +++ b/res/loc/rufus.loc @@ -578,6 +578,7 @@ t MSG_315 "Multiple buttons" t MSG_316 "Number of passes" t MSG_317 "Disk ID" t MSG_318 "Default thread priority: %d" +t MSG_319 "Ignore Boot Marker" ######################################################################### l "ar-SA" "Arabic (العربية)" 0x0401, 0x0801, 0x0c01, 0x1001, 0x1401, 0x1801, 0x1c01, 0x2001, 0x2401, 0x2801, 0x2c01, 0x3001, 0x3401, 0x3801, 0x3c01, 0x4001 diff --git a/src/drive.c b/src/drive.c index 6b324cd6..39b6380c 100644 --- a/src/drive.c +++ b/src/drive.c @@ -1293,7 +1293,6 @@ const struct {int (*fn)(FILE *fp); char* str;} known_mbr[] = { // Returns TRUE if the drive seems bootable, FALSE otherwise BOOL AnalyzeMBR(HANDLE hPhysicalDrive, const char* TargetName, BOOL bSilent) { - const char* mbr_name = "Master Boot Record"; FAKE_FD fake_fd = { 0 }; FILE* fp = (FILE*)&fake_fd; int i; @@ -1302,17 +1301,17 @@ BOOL AnalyzeMBR(HANDLE hPhysicalDrive, const char* TargetName, BOOL bSilent) set_bytes_per_sector(SelectedDrive.SectorSize); if (!is_br(fp)) { - suprintf("%s does not have an x86 %s", TargetName, mbr_name); + suprintf("%s does not have a Boot Marker", TargetName); return FALSE; } for (i=0; i Toggle the check for the 0x55 0xAA boot marker at offset 0x1fe. + // This means that Rufus treats anything selected as a writeable DD image. + if ((msg.message == WM_SYSKEYDOWN) && (msg.wParam == 'M')) { + ignore_boot_marker = !ignore_boot_marker; + WriteSettingBool(SETTING_IGNORE_BOOT_MARKER, ignore_boot_marker); + PrintStatusTimeout(lmprintf(MSG_319), ignore_boot_marker); + continue; + } // Alt N => Enable NTFS compression if ((msg.message == WM_SYSKEYDOWN) && (msg.wParam == 'N')) { enable_ntfs_compression = !enable_ntfs_compression; diff --git a/src/rufus.h b/src/rufus.h index 2825eb0f..e53d939b 100644 --- a/src/rufus.h +++ b/src/rufus.h @@ -343,7 +343,7 @@ typedef struct { int64_t mismatch_size; uint32_t wininst_version; BOOLEAN is_iso; - BOOLEAN is_bootable_img; + uint8_t is_bootable_img; BOOLEAN is_vhd; BOOLEAN is_windows_img; BOOLEAN disable_iso; @@ -567,7 +567,7 @@ extern BOOL WimExtractFile(const char* wim_image, int index, const char* src, co extern BOOL WimExtractFile_API(const char* image, int index, const char* src, const char* dst, BOOL bSilent); extern BOOL WimExtractFile_7z(const char* image, int index, const char* src, const char* dst, BOOL bSilent); extern BOOL WimApplyImage(const char* image, int index, const char* dst); -extern BOOL IsBootableImage(const char* path); +extern uint8_t IsBootableImage(const char* path); extern BOOL AppendVHDFooter(const char* vhd_path); extern int SetWinToGoIndex(void); extern int IsHDD(DWORD DriveIndex, uint16_t vid, uint16_t pid, const char* strid); diff --git a/src/rufus.rc b/src/rufus.rc index 48764cfe..06783ffa 100644 --- a/src/rufus.rc +++ b/src/rufus.rc @@ -33,7 +33,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL IDD_DIALOG DIALOGEX 12, 12, 232, 326 STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU EXSTYLE WS_EX_ACCEPTFILES -CAPTION "Rufus 3.13.1723" +CAPTION "Rufus 3.13.1724" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -395,8 +395,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 3,13,1723,0 - PRODUCTVERSION 3,13,1723,0 + FILEVERSION 3,13,1724,0 + PRODUCTVERSION 3,13,1724,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -414,13 +414,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "3.13.1723" + VALUE "FileVersion", "3.13.1724" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", "© 2011-2020 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-3.13.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "3.13.1723" + VALUE "ProductVersion", "3.13.1724" END END BLOCK "VarFileInfo" diff --git a/src/settings.h b/src/settings.h index ade24de8..06a13f0f 100644 --- a/src/settings.h +++ b/src/settings.h @@ -42,6 +42,7 @@ extern char* ini_file; #define SETTING_ENABLE_VMDK_DETECTION "EnableVmdkDetection" #define SETTING_ENABLE_WIN_DUAL_EFI_BIOS "EnableWindowsDualUefiBiosMode" #define SETTING_FORCE_LARGE_FAT32_FORMAT "ForceLargeFat32Formatting" +#define SETTING_IGNORE_BOOT_MARKER "IgnoreBootMarker" #define SETTING_INCLUDE_BETAS "CheckForBetas" #define SETTING_LAST_UPDATE "LastUpdateCheck" #define SETTING_LOCALE "Locale" diff --git a/src/vhd.c b/src/vhd.c index 623736da..17d9f968 100644 --- a/src/vhd.c +++ b/src/vhd.c @@ -111,6 +111,7 @@ PF_TYPE_DECL(RPC_ENTRY, RPC_STATUS, UuidCreate, (UUID __RPC_FAR*)); uint32_t wim_nb_files, wim_proc_files, wim_extra_files; HANDLE apply_wim_thread = NULL; extern int default_thread_priority; +extern BOOL ignore_boot_marker; static uint8_t wim_flags = 0; static wchar_t wmount_path[MAX_PATH] = { 0 }; @@ -277,7 +278,8 @@ BOOL IsCompressedBootableImage(const char* path) return FALSE; } -BOOL IsBootableImage(const char* path) +// 0: non-bootable, 1: bootable, 2: forced bootable +uint8_t IsBootableImage(const char* path) { HANDLE handle = INVALID_HANDLE_VALUE; LARGE_INTEGER liImageSize; @@ -287,7 +289,7 @@ BOOL IsBootableImage(const char* path) uint32_t checksum, old_checksum; uint64_t wim_magic = 0; LARGE_INTEGER ptr = { 0 }; - BOOL is_bootable_img = FALSE; + uint8_t is_bootable_img = 0; uprintf("Disk image analysis:"); handle = CreateFileU(path, GENERIC_READ, FILE_SHARE_READ, NULL, @@ -297,9 +299,9 @@ BOOL IsBootableImage(const char* path) goto out; } - is_bootable_img = (BOOLEAN)IsCompressedBootableImage(path); + is_bootable_img = IsCompressedBootableImage(path) ? 1 : 0; if (img_report.compression_type == BLED_COMPRESSION_NONE) - is_bootable_img = (BOOLEAN)AnalyzeMBR(handle, " Image", FALSE); + is_bootable_img = AnalyzeMBR(handle, " Image", FALSE) ? 1 : (ignore_boot_marker ? 2 : 0); if (!GetFileSizeEx(handle, &liImageSize)) { uprintf(" Could not get image size: %s", WindowsErrorString()); @@ -326,7 +328,7 @@ BOOL IsBootableImage(const char* path) if ( (bswap_uint32(footer->file_format_version) != VHD_FOOTER_FILE_FORMAT_V1_0) || (bswap_uint32(footer->disk_type) != VHD_FOOTER_TYPE_FIXED_HARD_DISK)) { uprintf(" Unsupported type of VHD image"); - is_bootable_img = FALSE; + is_bootable_img = 0; goto out; } // Might as well validate the checksum while we're at it