From f669f0540348bfc53f96c469cb97d17f37231b74 Mon Sep 17 00:00:00 2001 From: Pete Batard Date: Tue, 5 Apr 2022 18:31:03 +0100 Subject: [PATCH] [iso] add ISOHybrid "CD" partition and ISO9660 file system detection * Notably for openSUSE-Leap-15.3-XFCE-Live-x86_64-Build9.427-Media.iso --- src/drive.c | 7 +++++-- src/mbr_types.h | 1 + src/rufus.rc | 10 +++++----- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/drive.c b/src/drive.c index 778c67d7..93be4dcf 100644 --- a/src/drive.c +++ b/src/drive.c @@ -1748,12 +1748,15 @@ const char* GetFsName(HANDLE hPhysical, LARGE_INTEGER StartingOffset) if (buf == NULL) goto out; - // 1. Try to detect FAT/exFAT/NTFS/ReFS through the 512 bytes superblock at offset 0 + // 1. Try to detect ISO9660/FAT/exFAT/NTFS/ReFS through the 512 bytes superblock at offset 0 if (!SetFilePointerEx(hPhysical, StartingOffset, NULL, FILE_BEGIN)) goto out; if (!ReadFile(hPhysical, buf, sector_size, &size, NULL) || size != sector_size) goto out; - + if (strncmp("CD001", &buf[0x01], 5) == 0) { + ret = "ISO9660"; + goto out; + } // The beginning of a superblock for FAT/exFAT/NTFS/ReFS is pretty much always the same: // There are 3 bytes potentially used for a jump instruction, and then are 8 bytes of diff --git a/src/mbr_types.h b/src/mbr_types.h index caa43738..97438acf 100644 --- a/src/mbr_types.h +++ b/src/mbr_types.h @@ -150,6 +150,7 @@ mbr_type_t mbr_type[] = { { 0xc4, "DR DOS Extended" }, { 0xc6, "DR DOS FAT16" }, { 0xc7, "Syrinx" }, + { 0xcd, "ISOHybrid" }, { 0xda, "Non-FS Data" }, { 0xdb, "CP/M" }, { 0xde, "Dell Utility" }, diff --git a/src/rufus.rc b/src/rufus.rc index 9f61828d..d323b4fb 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.19.1879" +CAPTION "Rufus 3.19.1880" 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,19,1879,0 - PRODUCTVERSION 3,19,1879,0 + FILEVERSION 3,19,1880,0 + PRODUCTVERSION 3,19,1880,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.19.1879" + VALUE "FileVersion", "3.19.1880" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", "© 2011-2022 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-3.19.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "3.19.1879" + VALUE "ProductVersion", "3.19.1880" END END BLOCK "VarFileInfo"