Commit graph

2243 commits

Author SHA1 Message Date
Pete Batard
13c6becf42
[core] fix size check for VHD images
* Recent changes broke the check for whether the source image is larger than the target drive
  in the case of uncompressed VHDs (that have a 512 byte footer), so fix that by making sure
  we always compare with the projected size.
* Closes #2729.
* Also fix some more Coverity warnings.
2025-05-07 13:35:48 +01:00
Pete Batard
965759f58a
[ui] fix a crash when opening the log for MinGW x86_32 executable
* DwmGetWindowAttribute() from dwmapi.dll is delay-loaded so it requires the MinGW DECLSPEC_IMPORT workaround.
* Closes #2728.
* Also fix a bunch of Coverity warnings in wimlib and ezxml.
2025-05-06 18:43:35 +01:00
Pete Batard
ea01cd41c0
[iso] enable splitting of large WIMs when Alt-E is enabled
* Now that we have wimlib, we might as well add this has an option for people who really
  don't want to use NTFS, even if it falls way short of the performance we get with NTFS.
* Also use wimlib to read the install.wim version.
* Also fix a couple Coverity warnings in stdfn.c/stdio.c.
2025-05-06 01:35:26 +01:00
Pete Batard
2470c56c7e
[wue] switch to using wimlib for all WIM operations
* This should greatly improves performance when patching boot.wim for WUE or creating Windows To Go drives.
* This also allows us to discard all the bulky (and limited) native WIM API function calls.
* Also add some UTF-8 wrappers to wimlib and a GetTempDirNameU() function call.
* Also revert to the old ssize_t definition in unistd.h, since trying to be too smart throws static analysers off...
2025-05-05 00:58:07 +01:00
Pete Batard
5d35a0f1fa
[ui] progress reporting improvements
* Factorize the log progress bar update into a new uprint_progress() call.
* Add a new FP_NO_PROGRESS flag to disable progress reporting when formatting.
* Alter the progress reporting frequency of wimlib.
* Also update some copyright dates we missed before.
2025-05-03 21:32:10 +01:00
Pete Batard
96996ae1ee
[vhd] add libcdio integration to wimlib
* Allows working with WIMs without mounting the ISO by referencing something like "C:\Downloads\Windows.iso|sources/install.wim".
2025-05-02 17:28:42 +01:00
Pete Batard
c288f2fe57
[iso] add udf_setpos() support in libcdio
* This is needed for wimlib libcdio integration.
* Also fix a signed/unsigned warning in iso.c.
2025-05-02 17:27:24 +01:00
Pete Batard
9f7d623e2e
[vhd] add wimlib support
* This includes all the changes applied to wimlib for MSVC compilation support.
* The vast majority of these changes were original, but a very small set came
  was lifted from https://github.com/ebiggers/wimlib/pull/6 (which we discovered
  after we went through this whole exercise on our own...)
2025-05-02 17:25:37 +01:00
Pete Batard
1ed92072b8
[vhd] initial wimlib support (original sources)
* From https://wimlib.net/git/?p=wimlib;a=commit;h=4a34203cde54c317f0d277a4c64e19916547bf10
2025-05-02 17:25:35 +01:00
Pete Batard
e60dd7edb8
[wue] add ezxml support for WIM index parsing
* ezxml was partially altered with some changes from PRs found at https://github.com/lxfontes/ezxml.
* Also apply some small improvements to msapi_utf8.h.
2025-05-02 16:51:30 +01:00
Pete Batard
c31df87732
[wue] initial ezxml sources (unmodified)
* From the ezxml-0.8.6.tar.gz download at https://ezxml.sourceforge.net/.
2025-05-02 16:51:29 +01:00
Pete Batard
b895f26ebc
[misc] miscellaneous cleanup
* Make sure we use _M_IX86 and _M_X64 where required.
* Fix some static analysis warnings.
* Update version for rufus-next.
2025-04-21 20:20:59 +01:00
Pete Batard
88f023e796
Rufus 4.7 (Build 2231)
* Update FreeDOS to v1.4
* Update Grub4DOS to latest
2025-04-09 11:10:21 +01:00
Pete Batard
7ff68dc7af
[appstore] drop ARM32 from packaged builds and use our own PE data extractor instead of exiftool
* exiftool is way too cumbersome as a "standalone" commandline executable for our purpose.
* Also update French translation.
2025-04-02 12:16:33 +01:00
Pete Batard
871bc9a25f
[core] fix ReFS no longer being available unless VDS is enabled 2025-03-31 20:39:19 +01:00
Pete Batard
fdde687d46
[uefi] embed and allow the download of official signed DBX binaries
* With Microsoft having finally relinquished the terms of use of DBX binaries (where their
  previous legalese pretty much made it illegal for anyone who wasn't an OS manufacturer to
  download DBX for use in applications) we can now formally embed, as well as download the
  DBXs when they are updated.
* This is accomplished by querying the https://github.com/microsoft/secureboot_objects
  GitHub repo (which is now the official repository for the UEFI Forum's revocation files)
  through api.github.com and checking the timestamps of the last commit on the relevant files.
  If a more recent DBX is found than the one embedded (or a previously downloaded one), Rufus
  will now prompt the user to download it, as part of its regular update check (if enabled).
* Note that, since there have been no official revocations for them yet, IA64, RISCV64 and
  LoongArch64 are currently placeholders.
* Also note that we currently don't use this mechanism for Microsoft's SVN revocations, as
  we already have a more efficient check for it through SBAT.
* Also fix the handling of the RISCV64 MD5Sum UEFI bootloader, whose offset was incorrect.
2025-03-27 16:11:45 +00:00
Pete Batard
845d26e3b6
[ui] fix toolbar ImageLists leaks
* Also fix erroneous use of safe_delete_object() in previous commit and harmonize names.
* Closes #2711.
2025-03-24 13:18:20 +00:00
ozone10
df4f8301d7
[ui] fix GDI leaks
* Closes #2704.
2025-03-21 12:19:16 +00:00
Pete Batard
bc75274a9a
[msvc] further prevent DLL side-loading by using /DEPENDENTLOADFLAG:0x800
* Suggested by @dimhotepus per #2701.
* Sadly a similar feature can't be applied for MinGW builds. (See also 59156023/)
* While we're at it, also sure we use /BREPRO everywhere for MSVC reproducible builds.
2025-03-04 11:47:11 +00:00
Pete Batard
7585a35c2c
[core] improve detection for images that are too large to fit the target drives
* Rufus did not check if the size of the decompressed VHDX was larger than target. Fix that.
2025-02-21 17:53:38 +00:00
Pete Batard
9540ca359d
[misc] don't enable the commandline hogger on POSIX shells
* Assume that the presence of a "SHELL" environment variable is enough to tell if we have a POSIX shell.
2025-02-20 13:13:44 +00:00
Pete Batard
622e60659c
[dev] fix a side-loading vulnerability with cfgmgr32.dll
* Current Rufus and earlier versions (when compiled with MinGW) suffer from a side-loading vulnerability
  due to cfgmgr32.dll being attempted to be loaded from the same directory as the executable. This may
  result in someone being able to execute elevated malicious code if they already have gained user-level
  access to the platform and were able to drop an arbitrary cfgmgr32.dll in the same directory as rufus.
* While we were able to address similar vulnerabilities using delay-loading, this method does not appear
  to work for MinGW with this specific DLL, so we remove all the implicit CM_ function calls, that result
  in automated DLL loading that cannot be mitigated, to replace them with direct DLL hooks, which are
  not subject to Windows' default (vulnerable) DLL lookup behaviour. We still add the def for the delay
  loading in case we manage to find how to delay load cfgmgr32 with MinGW in the future...
* Fixes CVE-2025-26624 (https://github.com/pbatard/rufus/security/advisories/GHSA-p8p5-r296-g2jv).
* This vulnerability was discovered by @EmperialX working with @Shauryae1337 and reported by @EmperialX.
2025-02-19 11:58:10 +00:00
Rairii
50801a47ff
[misc] fall back to user/system default locale when getting error description
* Some Windows localisations do not contain English MUI files for specific error codes, so show *something* instead of an error.
* Closes #2687.
2025-02-14 01:07:43 +00:00
Pete Batard
f3c29bf537
[misc] fix and silence some Coverity warnings 2025-02-13 15:14:53 +00:00
lucamosca1
ec604f43d6
[loc] fix a typo in the Italian translation
* Closes #2675.
2025-02-10 17:47:29 +00:00
Pete Batard
d910441427
[misc] Fix issue template no longer being processed
* Since GitHub broke existing paths and did not bother to alert people.
* Closes #2672.
2025-01-25 13:06:07 +00:00
Pete Batard
1c300b428a
[uefi] update UEFI DBX to latest
* This is in light of the 2025.01.14 DBX update due to https://arstechnica.com/security/2025/01/microsoft-patches-windows-to-eliminate-secure-boot-bypass-threat/.
* Also update application copyright year and a translator's e-mail address.
2025-01-24 00:30:22 +00:00
Emmanuel Bourg
1e2f1c1aff
[loc] Improve the French translation
* Closes #2636.
2024-12-17 14:57:51 +01:00
Pete Batard
3d5ab84ec1
[iso] fix FAT filenames being truncated on image extraction
* Needed to read 12 chars instead of stopping at 11 and therefore inserting a NUL.
* Closes #2534.
* Also enable detection of bootriscv64.efi and bootloongarch64.efi bootloaders from FAT images.
2024-12-03 13:53:41 +00:00
Pete Batard
8d1ed44e1e
[cmd] fix hogger not being deleted on exit when executable is in a different directory
* Closes #2622.
2024-12-03 11:51:18 +00:00
Pete Batard
79f1209ab9
[misc] arch/cpu refactoring
* Move the cpu.c/cpu.h in more logical places and remove these sources files.
* Add detection for LoongArch64 EFI bootloaders.
* Pass the detected CPU arch when invoking Fido.
* Also fix some Bled Coverity warnings.
2024-12-02 19:04:51 +00:00
Pete Batard
8f3a9c1c7c
[cmp] update Bled to latest
* This mostly updates the ZSTD code to latest and properly removes all debug message.
* Also switch MinGW from gnu99 to gnu11.
2024-11-27 17:19:36 +00:00
Pete Batard
cef7a5cb0c
[cmp] add ztsd image compression support
* Based on the latest Bled, which adds ztsd compression support.
* Note that initial extraction of the 512 bytes MBR is very slow, because is seems
  clear that ZSTD was never designed for fast init or processing small elements of
  data, but instead for post init large volume streaming.
* Also note that this code adds 400 KB to the Rufus executable *AFTER UPX COMPRESSION*!
  Hopefully, the BusyBox folks can come up with a better and smaller way to add zstd
  support, because it's clear that the method used by the current BusyBox proposal,
  which is to leave as much of the original code untouched, isn't for the best...
* Closes #2590.
* Closes #2620.
* Closes #2621.
2024-11-22 23:25:33 +00:00
Pete Batard
fcdde3dcb8
[misc] drop ARM32 builds
* Per https://github.com/actions/runner-images/issues/10981 and plenty of other similar
  reports, GitHub Actions can no longer compile ARM32 binaries by default using the
  latest Visual Studio toolchain, due to Microsoft current Windows SDK having dropped
  the ARM32 toolchain (per https://github.com/zufuliu/notepad4/issues/839).
* Well, I have better things to do then try to maintain platforms in the process of
  being deprecated, so I'll let the people who care about Rufus on ARM32 propose a
  non-intrusive workaround that can work with current GitHub Actions.
2024-11-22 00:18:58 +00:00
Pete Batard
37e383ade6
[dev] add disk exclusion by GPT Disk GUID
* Similar to what we already do with IgnoreUSB##, except this time, users
  can add REG_SZ keys IgnoreDisk01 to IgnoreDisk08, with a string like
  "{F333EC2E-25C9-488D-A7FC-9147C2367623}" to ignore a GPT disk with this
  specific GUID.
* This may be useful for people who mount fixed virtual drives, or people
  who have enabled Hot Swap on their SATA storage, and who want to make sure
  they won't be able to inadvertently select that disk in Rufus.
* Also set rufus-next to 4.7.
2024-11-22 00:03:13 +00:00
Pete Batard
7488e4464d
Rufus 4.6 (Build 2208) 2024-10-21 15:46:25 +01:00
Justin Miller
accc7c000b
[iso] check for freeldr.sys as well for ReactOS
* Closes #2589.

Signed-off-by: Justin Miller <justin.miller@reactos.org>
2024-10-18 17:15:40 +01:00
Pete Batard
eb282642ff
[misc] fix conversion of windows error codes
* Commit f453dc272b improved on error message reporting, but went a bit
  too far in trying to let Windows facilities sort their messages out.
* Add a retry that clears the facility, so that, for one thing, we get wininet
  messages properly processed, regardless of the official facility assigned.
2024-10-14 17:39:17 +01:00
Pete Batard
4d42b7a73a
[efi] further improve revoked UEFI bootloader reporting
* Do not report SBAT revocations unless we actually have a formal Secure Boot signed bootloader.
* Also reduce verbose log pollution by libcdio.
2024-10-10 13:37:55 +01:00
Pete Batard
5439ca8a83
[md5sum] fix md5sum computation for the setup wrapper
* Also fix a couple small memory leaks and potential NULL deref.
* Also report saved path when saving to image.
2024-10-10 13:04:58 +01:00
Pete Batard
ede52c57e6
[misc] improve revoked UEFI bootloader reporting
* Also fix SBAT not being properly parsed for PE32 executables.
* Also fix signature truncation in GetIssuerCertificateInfo() and fall back to
  returning signer data if issuer is not available (which is typically the case
  for GRUB signed bootloaders).
* Also fix status messages on user cancellation/proceeding.
2024-10-09 20:18:42 +01:00
Pete Batard
6b5837dbb5
[iso] add DBX certificate revocation validation and reporting
* This is currently only used to detect the use of 'Microsoft Windows Production PCA 2011'
  signed bootloaders.
* Because the cert is still in the process of being revoked, and Windows 11 24H2 still uses
  'Microsoft Windows Production PCA 2011' signed bootloaders by default, only report this if
  running in expert mode.
* Also fix non-reachable code in wue.c.
2024-10-09 13:21:42 +01:00
Pete Batard
fd5c366938
[wue] add experimental option to replace Windows bootloaders with the 24H2 _EX versions
* This aims at creating installation media that is compatible with systems where
  'Microsoft Windows Production PCA 2011' has been revoked.
* Doesn't work, since the bootloaders being applied by the first stage installer come
  from \sources\install.wim[#]\windows\system32\Recovery\Winre.wim[#]\Windows\Boot\
  (instead of \sources\boot.wim[#]\Windows\Boot\ as one would naturally expect) and
  Microsoft botched the ones they included there by using completely vulnerable (and
  therefore revoked) ones.
  See https://github.com/pbatard/rufus/issues/2244#issuecomment-2400380839.
* Still, I sure haven't gone through this excruciating ACL bullshit for nothing, so
  you get an experimental option, behind the expert mode curtain.
2024-10-09 00:45:12 +01:00
Pete Batard
c800448c62
[wue] add setup wrapper to add bypasses for in-place upgrades of Windows 11 24H2
* Per https://forums.mydigitallife.net/threads/win-11-boot-and-upgrade-fix-kit-v5-0-released.83724/
  Windows 11 24H2 requires new registry bypasses to be applied to perform in-place upgrade on
  non officially supported platforms, and those need to be enacted before running setup.exe.
* In order to streamline this, and because those registry bypasses require elevation, we rename
  setup.exe to setup.dll and add our own setup.exe wrapper to set the registry and then call the
  original setup.exe (through setup.dll).
* See https://github.com/pbatard/rufus/issues/2568
* Also fix some MinGW build warnings.
* Also fix the annoyance of TortoiseGit/Notepad++ altering the copyright symbol of rufus.rc.
2024-10-06 13:42:07 +01:00
Pete Batard
98a42a235f
[wue] add setup wrapper project for Windows 11 24H2 in-place upgrades 2024-10-05 20:21:47 +01:00
Pete Batard
3e840a94ce
[wue] set password not to expire when creating a local account
* Looks like using the 'net user USERNAME /logonpasswordchg:yes" might have the side effect
  of setting the main user account to expire after a few months. So to alleviate that, we'll
  just set the system policy to use passwords that never expire.
* Also clean up the PE parsing code and fix 2 Coverity warnings.
* Also fix typos, misprints and ditch the UNRELIABLE timestamp.acs.microsoft.com server.
2024-10-05 11:03:42 +01:00
Pete Batard
15c28434c0
[iso] add Microsoft SVN revocation validation and reporting
* See https://github.com/pbatard/rufus/issues/2244#issuecomment-2243661539
* Note that we don't use the GUID but the resource name for bootmgr.efi, as trying to figure
  out where the heck the relevant GUID is located in the PE code is not worth the effort.
* Also add internal fallback for sbat_level.txt if the user can't access our remote version.
* Also improve PE section lookup.
2024-10-05 01:05:55 +01:00
Pete Batard
c5d61f6696
[iso] add SBAT revocation validation and reporting 2024-10-03 20:25:19 +01:00
Pete Batard
f453dc272b
[misc] fix a potential double free and avoid nonsensical error messages
* buf could be freed twice in iso.c.
* Using HRESULT_CODE(error_code) in WindowsErrorString() could lead to "Error: SUCCESS" messages.
* Closes #2524.
* Also try to address potential issues that appear to have been seen in the wild.
2024-09-30 17:38:47 +01:00
Pete Batard
248a37e308
[cmd] fix hogger invocation for PowerShell
* Closes #2556.
* Also update issue template, dependabot frequency and signing cert references.
* Also harmonize segment addressing code in mbr.S.
2024-09-14 12:21:22 +01:00