From 2b5b6d2d7ce76c32129d09d9a4628e1f8d357a7b Mon Sep 17 00:00:00 2001 From: Pete Batard Date: Sun, 21 Jun 2026 14:21:28 +0100 Subject: [PATCH 1/3] [cmp] update Bled to latest and get projected size for compressed disk images * The latest Bled, when compiled with the BLED_EXPECT_DISK_IMAGE option, allows us to get the size of the decompressed disk image, even for compression formats that do not report the decompressed size natively, so use that. --- .vs/bled.vcxproj | 12 ++++---- src/bled/Makefile.am | 2 +- src/bled/Makefile.in | 2 +- src/bled/bb_archive.h | 3 ++ src/bled/bled.c | 31 +++++++++++++++++-- src/bled/bled_size.c | 69 +++++++++++++++++++++++++++++++++++++------ src/rufus.c | 5 +++- src/rufus.rc | 10 +++---- src/vhd.c | 3 ++ 9 files changed, 111 insertions(+), 26 deletions(-) diff --git a/.vs/bled.vcxproj b/.vs/bled.vcxproj index f4b7c146..de587bfb 100644 --- a/.vs/bled.vcxproj +++ b/.vs/bled.vcxproj @@ -162,7 +162,7 @@ Level3 ProgramDatabase Disabled - _OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;_FILE_OFFSET_BITS=64;_CRTDBG_MAP_ALLOC;%(PreprocessorDefinitions) + BLED_EXPECT_DISK_IMAGE;_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;_FILE_OFFSET_BITS=64;_CRTDBG_MAP_ALLOC;%(PreprocessorDefinitions) MultiThreadedDebug ..\src CompileAsC @@ -181,7 +181,7 @@ Level3 ProgramDatabase Disabled - _OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;_FILE_OFFSET_BITS=64;_CRTDBG_MAP_ALLOC;%(PreprocessorDefinitions) + BLED_EXPECT_DISK_IMAGE;_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;_FILE_OFFSET_BITS=64;_CRTDBG_MAP_ALLOC;%(PreprocessorDefinitions) MultiThreadedDebug ..\src /utf-8 %(AdditionalOptions) @@ -200,7 +200,7 @@ ProgramDatabase EnableFastChecks Disabled - _OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;_FILE_OFFSET_BITS=64;_CRTDBG_MAP_ALLOC;%(PreprocessorDefinitions) + BLED_EXPECT_DISK_IMAGE;_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;_FILE_OFFSET_BITS=64;_CRTDBG_MAP_ALLOC;%(PreprocessorDefinitions) MultiThreadedDebug ..\src CompileAsC @@ -217,7 +217,7 @@ Level3 - _OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;_FILE_OFFSET_BITS=64;%(PreprocessorDefinitions) + BLED_EXPECT_DISK_IMAGE;_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;_FILE_OFFSET_BITS=64;%(PreprocessorDefinitions) MultiThreaded ..\src CompileAsC @@ -238,7 +238,7 @@ Level3 true - _OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;_FILE_OFFSET_BITS=64;%(PreprocessorDefinitions) + BLED_EXPECT_DISK_IMAGE;_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;_FILE_OFFSET_BITS=64;%(PreprocessorDefinitions) MultiThreaded ..\src /utf-8 %(AdditionalOptions) @@ -257,7 +257,7 @@ Level3 - _OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;_FILE_OFFSET_BITS=64;%(PreprocessorDefinitions) + BLED_EXPECT_DISK_IMAGE;_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;_FILE_OFFSET_BITS=64;%(PreprocessorDefinitions) MultiThreaded ..\src CompileAsC diff --git a/src/bled/Makefile.am b/src/bled/Makefile.am index 3e059834..3827cc51 100644 --- a/src/bled/Makefile.am +++ b/src/bled/Makefile.am @@ -7,4 +7,4 @@ libbled_a_SOURCES = bled.c bled_size.c crc32.c data_align.c data_extract_all.c d init_handle.c open_transformer.c seek_by_jump.c seek_by_read.c xz_dec_bcj.c xz_dec_lzma2.c xz_dec_stream.c \ xxhash.c zstd_common.c zstd_decompress.c zstd_decompress_block.c zstd_ddict.c zstd_entropy_common.c \ zstd_error_private.c -libbled_a_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/.. -Wno-undef -Wno-strict-aliasing +libbled_a_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/.. -DBLED_EXPECT_DISK_IMAGE -Wno-undef -Wno-strict-aliasing diff --git a/src/bled/Makefile.in b/src/bled/Makefile.in index 1a59d13a..f0a4c484 100644 --- a/src/bled/Makefile.in +++ b/src/bled/Makefile.in @@ -285,7 +285,7 @@ libbled_a_SOURCES = bled.c bled_size.c crc32.c data_align.c data_extract_all.c d xxhash.c zstd_common.c zstd_decompress.c zstd_decompress_block.c zstd_ddict.c zstd_entropy_common.c \ zstd_error_private.c -libbled_a_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/.. -Wno-undef -Wno-strict-aliasing +libbled_a_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/.. -DBLED_EXPECT_DISK_IMAGE -Wno-undef -Wno-strict-aliasing all: all-am .SUFFIXES: diff --git a/src/bled/bb_archive.h b/src/bled/bb_archive.h index 284bbffb..2e8a6ff6 100644 --- a/src/bled/bb_archive.h +++ b/src/bled/bb_archive.h @@ -254,6 +254,9 @@ typedef struct transformer_state_t { } magic; } transformer_state_t; +typedef int64_t(*unpacker_t)(transformer_state_t* xstate); +typedef int64_t(*get_uncompressed_size_t)(int fd); +int64_t get_uncompressed_size(int fd, int type); void init_transformer_state(transformer_state_t *xstate) FAST_FUNC; ssize_t transformer_write(transformer_state_t *xstate, const void *buf, size_t bufsize) FAST_FUNC; ssize_t xtransformer_write(transformer_state_t *xstate, const void *buf, size_t bufsize) FAST_FUNC; diff --git a/src/bled/bled.c b/src/bled/bled.c index 37331b43..c421cab5 100644 --- a/src/bled/bled.c +++ b/src/bled/bled.c @@ -15,9 +15,6 @@ #include "bb_archive.h" #include "bled.h" -typedef int64_t(*unpacker_t)(transformer_state_t *xstate); -extern int64_t get_uncompressed_size(int fd, int type); - /* Globals */ smallint bb_got_signal; uint64_t bb_total_rb, bb_total_wb; @@ -303,6 +300,34 @@ int64_t bled_uncompress_from_buffer_to_buffer(const char* src, const size_t src_ return ret; } +/* Get the decompressed size of file 'src', compressed using 'type' */ +int64_t bled_get_uncompressed_size(const char* src, int type) +{ + int fd = -1; + int64_t ret = -1; + + if (!bled_initialized) { + bb_error_msg("The library has not been initialized"); + return -1; + } + + if ((type < 0) || (type >= BLED_COMPRESSION_MAX)) { + bb_error_msg("Unsupported compression format"); + goto err; + } + + fd = _openU(src, _O_RDONLY | _O_BINARY, 0); + if (fd < 0) + return -1; + + ret = get_uncompressed_size(fd, type); + +err: + if (fd > 0) + _close(fd); + return ret; +} + /* Initialize the library. * When the parameters are not NULL or zero you can: * - specify the buffer size to use (must be larger than 256KB and a power of two) diff --git a/src/bled/bled_size.c b/src/bled/bled_size.c index ee5a9736..403c3e2b 100644 --- a/src/bled/bled_size.c +++ b/src/bled/bled_size.c @@ -15,8 +15,6 @@ #include "bb_archive.h" #include "bled.h" -typedef int64_t(*get_uncompressed_size_t)(int fd); - /* ------------------------------------------------------------------------- * Internal helpers * ---------------------------------------------------------------------- */ @@ -702,6 +700,61 @@ static int64_t get_uncompress_size_zstd(int fd) return (int64_t)size; } +#if defined(BLED_EXPECT_DISK_IMAGE) +extern progress_t bled_progress; +extern unpacker_t unpacker[BLED_COMPRESSION_MAX]; +int64_t get_uncompressed_size_from_disk_image(int fd, int type) +{ + progress_t old_bled_progress = bled_progress; + int64_t size = DECOMP_SIZE_UNKNOWN; + uint8_t buf[8192]; + transformer_state_t xstate; + + bled_progress = NULL; /* Can't have progress on this operation */ + init_transformer_state(&xstate); + xstate.src_fd = fd; + xstate.dst_fd = -1; + xstate.mem_output_buf = buf; + xstate.mem_output_size = 0; + xstate.mem_output_size_max = sizeof(buf); + + if (setjmp(bb_error_jmp)) + goto out; + + lseek(fd, 0, SEEK_SET); + size = unpacker[type](&xstate); + if (size != sizeof(buf) || buf[0x1fe] != 0x55 || buf[0x1ff] != 0xaa) { + size = DECOMP_SIZE_UNKNOWN; + goto out; + } + if (buf[0x1c2] == 0xee) { + /* Protective EFI MBR => look for the primary GPT, which'll also give us the sector size */ + if (memcmp("EFI PART", &buf[0x200], 8) == 0) { + /* The address of the backup GPT is assumed to be the last LBA for the disk */ + size = get_le64(&buf[0x220]) * 512; + goto out; + } + if (memcmp("EFI PART", &buf[0x1000], 8) == 0) { + size = get_le64(&buf[0x1020]) * 8192; + goto out; + } + } + if (buf[0x1be] == 0x80) { + /* Regular bootable MBR => compute the max LBA (using primary partitions only) */ + uint32_t max_lba = 1; + for (int i = 0; i < 4; i++) + max_lba = MAX(max_lba, get_le32(&buf[0x1be + 0x10 * i + 8]) + get_le32(&buf[0x1be + 0x10 * i + 0xc])); + size = max_lba * 512; /* assume 512-byte sectors for anything MBR based */ + if (size < 8192) + size = DECOMP_SIZE_UNKNOWN; + } + +out: + bled_progress = old_bled_progress; + return size; +} +#endif + static get_uncompressed_size_t _get_uncompressed_size[BLED_COMPRESSION_MAX] = { get_uncompress_size_none, get_uncompress_size_zip, @@ -718,13 +771,11 @@ static get_uncompressed_size_t _get_uncompressed_size[BLED_COMPRESSION_MAX] = { /* Get the decompressed size of file 'fd', compressed using 'type' */ int64_t get_uncompressed_size(int fd, int type) { - int64_t size = -1; - - if ((type < 0) || (type >= BLED_COMPRESSION_MAX)) { - bb_error_msg("Unsupported compression format"); - return -1; - } - size = _get_uncompressed_size[type](fd); + int64_t size = _get_uncompressed_size[type](fd); +#if defined(BLED_EXPECT_DISK_IMAGE) + if (size < 0) + size = get_uncompressed_size_from_disk_image(fd, type); +#endif /* Make sure to reset our file pointer */ lseek(fd, 0, SEEK_SET); diff --git a/src/rufus.c b/src/rufus.c index 09e34c45..4a92d6a0 100755 --- a/src/rufus.c +++ b/src/rufus.c @@ -1391,6 +1391,8 @@ DWORD WINAPI ImageScanThread(LPVOID param) (img_report.compression_type != BLED_COMPRESSION_NONE && img_report.compression_type < BLED_COMPRESSION_MAX) ? "compressed " : "", img_report.is_vhd ? "VHD" : "disk"); selection_default = BT_IMAGE; + if (img_report.projected_size > 0) + uprintf(" Size: %s (Projected)", SizeToHumanReadable(img_report.projected_size, FALSE, FALSE)); } if (img_report.is_iso) { @@ -1525,7 +1527,8 @@ static DWORD WINAPI BootCheckThread(LPVOID param) Notification(MB_OK | MB_ICONERROR, lmprintf(MSG_358), lmprintf(MSG_359)); goto out; } - if ((size_check) && (img_report.projected_size > (uint64_t)SelectedDrive.DiskSize)) { + /* Add 4 KB extra margin for VHD footers and so on */ + if ((size_check) && (img_report.projected_size > (uint64_t)SelectedDrive.DiskSize) + 4 * KB) { // This ISO image is too big for the selected target Notification(MB_OK | MB_ICONERROR, lmprintf(MSG_088), lmprintf(MSG_089)); goto out; diff --git a/src/rufus.rc b/src/rufus.rc index e388f48f..a4631124 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 4.15.2393" +CAPTION "Rufus 4.15.2394" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -409,8 +409,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,15,2393,0 - PRODUCTVERSION 4,15,2393,0 + FILEVERSION 4,15,2394,0 + PRODUCTVERSION 4,15,2394,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -428,13 +428,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.15.2393" + VALUE "FileVersion", "4.15.2394" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2026 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.15.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.15.2393" + VALUE "ProductVersion", "4.15.2394" END END BLOCK "VarFileInfo" diff --git a/src/vhd.c b/src/vhd.c index d0faa1f5..7444ee17 100644 --- a/src/vhd.c +++ b/src/vhd.c @@ -99,6 +99,9 @@ static int8_t IsCompressedBootableImage(const char* path) ErrorStatus = 0; if (img_report.compression_type < BLED_COMPRESSION_MAX) { bled_init(0, uprintf, NULL, NULL, NULL, NULL, &ErrorStatus); + dc = bled_get_uncompressed_size(path, file_assoc[i].type); + if (dc > 0) + img_report.projected_size = dc; dc = bled_uncompress_to_buffer(path, (char*)buf, MBR_SIZE, file_assoc[i].type); bled_exit(); } else if (img_report.compression_type == BLED_COMPRESSION_MAX) { From eedeaea75ff103b2df0f306ed972244abaf46b58 Mon Sep 17 00:00:00 2001 From: Pete Batard Date: Mon, 22 Jun 2026 18:15:06 +0100 Subject: [PATCH 2/3] [misc] fix multiple small issues * Use the actual Bled latest to fix a potential crash in ZSTD decompression as well as wrong disk size computation. * Fix wrong parenthesis placement for projected vs actual disk size check. * Update GitHub Actions to latest. Closes #3000. --- .github/workflows/codeql.yml | 2 +- .github/workflows/coverity.yml | 2 +- .github/workflows/mingw.yml | 2 +- .github/workflows/setup.yml | 2 +- .github/workflows/vs2026.yml | 2 +- src/bled/bled_size.c | 29 ++++++++++++++--------------- src/bled/decompress_unzstd.c | 4 ++-- src/rufus.c | 2 +- src/rufus.rc | 10 +++++----- 9 files changed, 27 insertions(+), 28 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 132541b4..1d45057d 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -41,7 +41,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v6 + uses: actions/checkout@v7 - name: Initialize CodeQL uses: github/codeql-action/init@v4 diff --git a/.github/workflows/coverity.yml b/.github/workflows/coverity.yml index fa324ed3..bbee991e 100644 --- a/.github/workflows/coverity.yml +++ b/.github/workflows/coverity.yml @@ -28,7 +28,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v6 + uses: actions/checkout@v7 with: fetch-depth: 0 submodules: recursive diff --git a/.github/workflows/mingw.yml b/.github/workflows/mingw.yml index 8e1df007..d59adfd5 100644 --- a/.github/workflows/mingw.yml +++ b/.github/workflows/mingw.yml @@ -54,7 +54,7 @@ jobs: upx - name: Checkout repository - uses: actions/checkout@v6 + uses: actions/checkout@v7 with: fetch-depth: 0 submodules: recursive diff --git a/.github/workflows/setup.yml b/.github/workflows/setup.yml index 0ff81dc5..c0fc073a 100644 --- a/.github/workflows/setup.yml +++ b/.github/workflows/setup.yml @@ -19,7 +19,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v6 + uses: actions/checkout@v7 - name: Add MSBuild to PATH uses: microsoft/setup-msbuild@v3 diff --git a/.github/workflows/vs2026.yml b/.github/workflows/vs2026.yml index 2c368afb..371f4d5a 100644 --- a/.github/workflows/vs2026.yml +++ b/.github/workflows/vs2026.yml @@ -40,7 +40,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v6 + uses: actions/checkout@v7 with: fetch-depth: 0 submodules: recursive diff --git a/src/bled/bled_size.c b/src/bled/bled_size.c index 403c3e2b..4c9dda1a 100644 --- a/src/bled/bled_size.c +++ b/src/bled/bled_size.c @@ -727,25 +727,24 @@ int64_t get_uncompressed_size_from_disk_image(int fd, int type) size = DECOMP_SIZE_UNKNOWN; goto out; } - if (buf[0x1c2] == 0xee) { - /* Protective EFI MBR => look for the primary GPT, which'll also give us the sector size */ - if (memcmp("EFI PART", &buf[0x200], 8) == 0) { - /* The address of the backup GPT is assumed to be the last LBA for the disk */ - size = get_le64(&buf[0x220]) * 512; - goto out; - } - if (memcmp("EFI PART", &buf[0x1000], 8) == 0) { - size = get_le64(&buf[0x1020]) * 8192; - goto out; - } - } - if (buf[0x1be] == 0x80) { + if (buf[0x1be] == 0x00 && buf[0x1c2] == 0xee) { + /* + * Protective EFI MBR => look for the primary GPT, which'll also give us the sector size + * The address of the backup GPT is assumed to be the last LBA for the disk + */ + if (memcmp("EFI PART", &buf[0x200], 8) == 0) + size = (get_le64(&buf[0x220]) + 1) * 512; + else if (memcmp("EFI PART", &buf[0x1000], 8) == 0) + size = (get_le64(&buf[0x1020]) + 1) * 4096; + else + bb_error_msg("Could not locate primary GPT"); + } else if (buf[0x1be] == 0x80) { /* Regular bootable MBR => compute the max LBA (using primary partitions only) */ uint32_t max_lba = 1; for (int i = 0; i < 4; i++) max_lba = MAX(max_lba, get_le32(&buf[0x1be + 0x10 * i + 8]) + get_le32(&buf[0x1be + 0x10 * i + 0xc])); - size = max_lba * 512; /* assume 512-byte sectors for anything MBR based */ - if (size < 8192) + size = (max_lba + 1) * 512; /* assume 512-byte sectors for anything MBR based */ + if (size < 4096) size = DECOMP_SIZE_UNKNOWN; } diff --git a/src/bled/decompress_unzstd.c b/src/bled/decompress_unzstd.c index 85eaa474..4c6cdee7 100644 --- a/src/bled/decompress_unzstd.c +++ b/src/bled/decompress_unzstd.c @@ -119,8 +119,8 @@ unpack_zstd_stream_inner(transformer_state_t *xstate, IF_DESKTOP(long long) int FAST_FUNC unpack_zstd_stream(transformer_state_t *xstate) { - const size_t in_allocsize = roundupsize(ZSTD_DStreamInSize(), 1024), - out_allocsize = roundupsize(ZSTD_DStreamOutSize(), 1024); + const size_t in_allocsize = roundupsize(ZSTD_DStreamInSize(), SECTOR_ALIGNMENT), + out_allocsize = roundupsize(ZSTD_DStreamOutSize(), SECTOR_ALIGNMENT); IF_DESKTOP(long long) int result; void *out_buff; diff --git a/src/rufus.c b/src/rufus.c index 4a92d6a0..83803ce3 100755 --- a/src/rufus.c +++ b/src/rufus.c @@ -1528,7 +1528,7 @@ static DWORD WINAPI BootCheckThread(LPVOID param) goto out; } /* Add 4 KB extra margin for VHD footers and so on */ - if ((size_check) && (img_report.projected_size > (uint64_t)SelectedDrive.DiskSize) + 4 * KB) { + if ((size_check) && (img_report.projected_size > ((uint64_t)SelectedDrive.DiskSize + 4 * KB))) { // This ISO image is too big for the selected target Notification(MB_OK | MB_ICONERROR, lmprintf(MSG_088), lmprintf(MSG_089)); goto out; diff --git a/src/rufus.rc b/src/rufus.rc index a4631124..b15b9e7a 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 4.15.2394" +CAPTION "Rufus 4.15.2395" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -409,8 +409,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,15,2394,0 - PRODUCTVERSION 4,15,2394,0 + FILEVERSION 4,15,2395,0 + PRODUCTVERSION 4,15,2395,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -428,13 +428,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.15.2394" + VALUE "FileVersion", "4.15.2395" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2026 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.15.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.15.2394" + VALUE "ProductVersion", "4.15.2395" END END BLOCK "VarFileInfo" From 6d8fbf98305ff37eb531c45cbd6ff44563c53917 Mon Sep 17 00:00:00 2001 From: Pete Batard Date: Tue, 30 Jun 2026 11:58:42 +0100 Subject: [PATCH 3/3] Rufus 4.15 (Build 2396) * Add SquashFS file system detection and update files DB to latest. --- ChangeLog.txt | 6 +++--- res/appstore/listing/listing.csv | 26 ++++++++++++-------------- src/db.h | 1 + src/drive.c | 6 +++++- src/rufus.rc | 10 +++++----- 5 files changed, 26 insertions(+), 23 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 37d86fbf..caa86595 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,12 +1,12 @@ -o Version 4.15 (2026.06.??) +o Version 4.15 (2026.06.30) Add RISC-V 64 support to UEFI:NTFS - Improve the guards for using the "silent" option + Improve the guards for using the "silent" Windows installation option Improve the ability to cancel during write retries Improve progress reporting for compressed image extraction Fix unrestricted XML entity expansion and integer overflow in ezxml parser (courtesy of Eric Sadowski) Fix "silent" Windows installation failing at 75% in most cases Fix a crash during boot when using UEFI:NTFS on Snapdragon X based ARM64 platforms - Fix the first WUE option always being checked by default + Fix first WUE option always being checked by default Fix an infinite loop when using Windows ISOs that contain multiple WIMs Fix "Enable runtime UEFI media validation" checkbox not always being properly enabled Other WUE improvements/fixes for OneDrive removal and username validation (with thanks to @christian8641) diff --git a/res/appstore/listing/listing.csv b/res/appstore/listing/listing.csv index 2880ae7f..dbc1c806 100644 --- a/res/appstore/listing/listing.csv +++ b/res/appstore/listing/listing.csv @@ -65,7 +65,7 @@ • Pakeitimų žurnalas: https://github.com/pbatard/rufus/blob/master/ChangeLog.txt","Rufus adalah utiliti yang membantu memformat dan mencipta pemacu kilat USB boot, seperti pemacu pen/kekunci USB, kayu memori, dan lain-lain. • Laman rasmi: https://rufus.ie • Kod Sumber: https://github.com/pbatard/rufus -• ChangeLog: https://github.com/pbatard/rufus/blob/master/ChangeLog.txt","Rufus er et verktøy som hjelper til med å formatere og lage oppstartbare USB-stasjoner, for eksempel USB-minnepinner, USB-harddisker, og lignende. +• Log Perubahan: https://github.com/pbatard/rufus/blob/master/ChangeLog.txt","Rufus er et verktøy som hjelper til med å formatere og lage oppstartbare USB-stasjoner, for eksempel USB-minnepinner, USB-harddisker, og lignende. • Offisiell webside: https://rufus.ie • Kildekode: https://github.com/pbatard/rufus • Endringslogg: https://github.com/pbatard/rufus/blob/master/ChangeLog.txt","Rufus ابزاری است که به فرمت و ایجاد درایوهای فلش USB قابل بوت، مانند کلیدهای USB/pendrives، مموری استیک ها و غیره به شما کمک می کند. @@ -114,19 +114,17 @@ • Trang web chính thức: https://rufus.ie • Mã nguồn: https://github.com/pbatard/rufus • Nhật ký thay đổi: https://github.com/pbatard/rufus/blob/master/ChangeLog.txt" -"ReleaseNotes","3","Text","• Windows User Experience improvements: -• - Add a ""Quality of Life"" option, to disable Teams, Outlook, Copilot and other Microsoft forced nuisances -• - Add a Silent installation option, that automatically, and WITHOUT PROMPT, installs Windows on the first detected disk -• - Add an option to copy 'SkuSiPolicy.p7b' to the ESP on installation (please refer to KB5042562 for more info) -• - Add tooltips for all the dialog options -• Add limited support for El-Torito UEFI image extraction (Mostly for Dell BIOS update ISOs) -• Improve error report when the user tries to use an image that resides on the target drive -• Improve the UEFI:NTFS partition label to make the install media more explicit during Windows Setup disk partitioning -• Improve support for Bazzite and other Fedora derivatives that don't follow EFI conventions -• Improve detection and exclusion of the new Bitdefender hidden VHDs -• Improve reporting of GRUB and Isolinux MBRs -• Fix potential errors during creation of Windows To Go media, due to the use of new versions of bcdboot -• Fix errors with local accounts that start or end with whitespaces",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +"ReleaseNotes","3","Text","• Add RISC-V 64 support to UEFI:NTFS +• Improve the guards for using the ""silent"" Windows installation option +• Improve the ability to cancel during write retries +• Improve progress reporting for compressed image extraction +• Fix unrestricted XML entity expansion and integer overflow in ezxml parser (courtesy of Eric Sadowski) +• Fix ""silent"" Windows installation failing at 75% in most cases +• Fix a crash during boot when using UEFI:NTFS on Snapdragon X based ARM64 platforms +• Fix first WUE option always being checked by default +• Fix an infinite loop when using Windows ISOs that contain multiple WIMs +• Fix ""Enable runtime UEFI media validation"" checkbox not always being properly enabled +• Other WUE improvements/fixes for OneDrive removal and username validation (with thanks to @christian8641)",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, "Title","4","Text","Rufus",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, "ShortTitle","5","Text","",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, "SortTitle","6","Text","",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, diff --git a/src/db.h b/src/db.h index c3197e9f..c4982b45 100644 --- a/src/db.h +++ b/src/db.h @@ -84,6 +84,7 @@ static uint8_t sha256db[] = { 0x82, 0x11, 0xfa, 0xe8, 0xaf, 0xf0, 0x23, 0x3f, 0x05, 0xa8, 0xb7, 0x8c, 0x58, 0x15, 0x25, 0xe2, 0x81, 0xac, 0x98, 0x23, 0x54, 0xa8, 0xc4, 0x3b, 0xb4, 0x96, 0x5e, 0x61, 0xdc, 0x98, 0xb4, 0x62, // syslinux-6.03/pre8/ldlinux.bss 0x83, 0x57, 0xaa, 0xd3, 0x6a, 0xec, 0x68, 0x21, 0xcb, 0xf2, 0x17, 0x4d, 0xb5, 0xd2, 0x09, 0xef, 0x2c, 0xd2, 0x62, 0x88, 0x12, 0x39, 0xeb, 0xc3, 0xf4, 0xc1, 0xcf, 0x55, 0xab, 0x10, 0xee, 0x55, // grub-2.12~rc1/core.img 0x83, 0x9b, 0xd0, 0x8a, 0xcb, 0x68, 0x47, 0xd6, 0x55, 0x07, 0xf1, 0x4e, 0x7a, 0x55, 0x6e, 0x91, 0xe6, 0x12, 0x9c, 0x47, 0x86, 0x3f, 0x7d, 0x61, 0xe2, 0xce, 0x6d, 0xb7, 0x8d, 0xf3, 0xd2, 0x3f, // syslinux-6.03/pre9/ldlinux.bss + 0x84, 0x73, 0x50, 0x4a, 0x84, 0x9c, 0x89, 0x83, 0x29, 0xcb, 0x90, 0x92, 0xf2, 0x5e, 0x26, 0x9d, 0x4e, 0x19, 0x3b, 0xc7, 0x72, 0xf8, 0x48, 0x9f, 0xa2, 0xc5, 0xd5, 0xa5, 0xd2, 0xd8, 0x87, 0x74, // grub-2.12-nonstandard-gdie/core.img 0x87, 0xaa, 0x91, 0xf8, 0x7f, 0xba, 0x5f, 0x31, 0x79, 0x43, 0x08, 0xda, 0xa4, 0xa4, 0x8d, 0xad, 0x6c, 0xf6, 0xfa, 0x34, 0x26, 0x4d, 0x66, 0xb8, 0x84, 0xb8, 0xb9, 0xdc, 0x96, 0x42, 0xed, 0x86, // syslinux-5.02/ldlinux.sys 0x88, 0x14, 0xe5, 0x76, 0xab, 0xc1, 0xaa, 0x44, 0xdd, 0xe9, 0x43, 0xb0, 0xca, 0xae, 0xe8, 0x33, 0xa5, 0x81, 0x01, 0x42, 0x61, 0x4a, 0xde, 0xeb, 0x4c, 0xc7, 0x25, 0xe7, 0x8a, 0x50, 0x45, 0xb7, // syslinux-6.03/ldlinux.bss 0x8b, 0x93, 0x7e, 0x5e, 0x8b, 0xae, 0x5a, 0xf8, 0xc8, 0x95, 0x63, 0xc0, 0x0e, 0x9c, 0xaf, 0xc6, 0xcd, 0x7c, 0x2c, 0x80, 0x8a, 0xda, 0x7b, 0xf4, 0xad, 0x51, 0x08, 0xda, 0x3e, 0x51, 0xcd, 0x70, // grub-2.00-22/core.img diff --git a/src/drive.c b/src/drive.c index 0b9a27eb..5c660348 100644 --- a/src/drive.c +++ b/src/drive.c @@ -1765,11 +1765,15 @@ const char* GetFsName(HANDLE hPhysical, LARGE_INTEGER StartingOffset) if (buf == NULL) goto out; - // 1. Try to detect ISO9660/FAT/exFAT/NTFS/ReFS through the 512 bytes superblock at offset 0 + // 1. Try to detect ISO9660/FAT/exFAT/NTFS/ReFS/SquashFS 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 (memcmp("hsqs", buf, 4) == 0) { + ret = "SquashFS"; + goto out; + } if (strncmp("CD001", &buf[0x01], 5) == 0) { ret = "ISO9660"; goto out; diff --git a/src/rufus.rc b/src/rufus.rc index b15b9e7a..abdf1754 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 4.15.2395" +CAPTION "Rufus 4.15.2396" FONT 9, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP @@ -409,8 +409,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 4,15,2395,0 - PRODUCTVERSION 4,15,2395,0 + FILEVERSION 4,15,2396,0 + PRODUCTVERSION 4,15,2396,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -428,13 +428,13 @@ BEGIN VALUE "Comments", "https://rufus.ie" VALUE "CompanyName", "Akeo Consulting" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "4.15.2395" + VALUE "FileVersion", "4.15.2396" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", " 2011-2026 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "OriginalFilename", "rufus-4.15.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "4.15.2395" + VALUE "ProductVersion", "4.15.2396" END END BLOCK "VarFileInfo"