84 Commits

Author SHA1 Message Date
Pete Batard
fec6051000 [wue] filter disallowed characters in local account names
* Per https://learn.microsoft.com/en-us/windows-hardware/customize/desktop/unattend/microsoft-windows-shell-setup-useraccounts-localaccounts-localaccount-name
* Also add 'NONE' to the list of prohibited local account names, and add '.' to the list of disallowed characters based on user report.
* Also update actions/upload-artifact to latest.
* Closes #2878.
* Closes #2879.
2025-12-20 13:36:06 +00:00
Pete Batard
10694ae42e Rufus 4.11 (Build 2285)
* Alter the WUE CA 2023 option text and remove duplicate translation for "ISO Image".
* Force cache-only when invoking CertGetCertificateChain (This should address #2781).
2025-10-02 17:53:22 +01:00
Pete Batard
56b4b9f249 [dbx] update SBAT/SVN to latest and improve reporting
* Explicitly report the SVN/SBAT number comparison in the log.
* Also don't perform revocation checks on unsigned bootloaders.
* Also add provision for CRLF handling when parsing our remote SBAT.
2025-10-01 13:08:58 +01:00
Pete Batard
94a2c7c2fb [ui] fix checkboxes being erroneously enabled
* The "Quick Format" and "Create extended label" checkbox could be enabled when no device
  is detected by checking the "List USB Hard Drives". Fix that.
* Also fix/silence some Coverity warnings (div by zero, overflow, unreachable code, uninit'd mem).
* Also ad @ozone10 to the credits for the Dark Mode UI.
2025-06-18 15:42:13 +01:00
Pete Batard
688f011f31 [iso] improve UEFI bootloader reporting
* Add systemd-boot version reporting and fix GRUB version detection for CentOS
* Add notes about the various Secure Boot gotchas (log only)
* Enable download of remote active/revoked Secure Boot certificate thumbprints
* Also rename the ceiling/floor align macros
2025-05-26 20:56:26 +01:00
Pete Batard
f3c29bf537 [misc] fix and silence some Coverity warnings 2025-02-13 15:14:53 +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
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
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
45423becd5 [vhd] fix VHDX being inadvertently saved as VHD
* Addresses the error reported in #2468.
* Also use memmove instead of memcpy where overlapping data is involved.
2024-05-12 13:06:23 +01:00
Pete Batard
513c5f44a5 [misc] fix possible buffer overflows in _snprintf()
* _snprintf() is not always guaranteed to NUL terminate a string which could
  lead to  buffer overflows in iso_extract_files() and iso_extract_files().
* Fix this by switching to using the more secure _snprintf_s().
* Vulnerability discovered and reported by Mansour Gashasbi (@gashasbi).
* For good measure, we also switch to the strncat_s() where possible and also
  use memmove() instead of memcpy()/strcpy() as the behaviour of the latter on
  overlapping memory regions is undefined.
* Also fix some additional MinGW warnings regarding casts and nb_blocks.
2024-04-17 17:19:03 +01:00
Pete Batard
7eb9a6f16b [misc] fix some benign Coverity warnings 2023-06-18 19:09:15 +02:00
Pete Batard
3a0f7d3813 [iso] attempt to fix the clusterfuck of GRUB 2.06 incompatible versions
* As was *ENTIRELY PREDICTIBLE*, the lack of timely releases from the GRUB
  project has resulted in distro maintainers (Ubuntu, Fedora, etc.) taking
  matters in their own hand and applying patches on top of their 2.06 version.
  However, these patches result in 2.06 bootloaders that are incompatible
  with 2.06 modules that don't have the same patches applied. Especially this
  now results in the infamous "452: out of range pointer" error message when
  using patched modules with unpatched bootloader or unpatched modules with
  patched bootloaders.
* Making this issue worse, we also have distro maintainers who won't add a
  suffix to their GRUB version, AS ONE SHOULD DO WHEN ONE APPLIES TONS OF
  PATCHES ON TOP OF A PROJECT'S SOURCE, and MISreport their non 2.06 GRUB as
  "2.06", and, because we can't detect what patches are needed from modules
  themselves (unlike what is the case for grub_debug_is_enabled), we have no
  way of telling incompatible GRUB 2.06 binaries from one another.
* As a result, we have no choice but to append a sanitized version of the ISO
  label to the GRUB version, as a means to differentiate between incompatible
  versions, and tweak our existing bootloader download mechanism to *ATTEMPT*
  to download a compatible 'core.img' from our server... where we will have
  to waste a lot of time adding new binaries and symlinks to try to make all
  these GRUB "2.06" based images work, and will probably miss quite few with
  the end results that users who are just trying to install Linux will be left
  stranded.
* Again, I have to point out how the end result of regular users wanting to
  try Linux and being unable to do so is the *DIRECT* result of the GRUB project
  maintainers having sat on a 2-year influx of CONTINUOUS patches, and thinking
  that "Release Early, Release Often" is only a gimmick, and not something that
  should apply to their project, even as they have been warned before, by yours
  truly, that *NOT* releasing on a timely basis is causing actual grievances...
  That's because, had the GRUB maintainers released on a timely basis (at least
  once a year) Fedora and Ubuntu would be using vanilla GRUB 2.07 with the memory
  patches, and we wouldn't be trying to mix that with old GRUB 2.06 binaries.
* For more on this, see #2233, noting that we will need to apply a compatibility
  breaking change during the 4.1 release, to revert the patches we applied to
  the default 2.06 'core.img' in pbatard/rufus-web@320b800592.
2023-05-16 14:05:28 +01:00
Pete Batard
1e51385bed [misc] revert to using the OS arch rather than app arch for the update download
* This means that someone running Rufus x64 or ARM64 should be
  proposed Rufus ARM64 rather than Rufus x64 as an upgrade.
* Also switch the BETA channel from x86 to x64.
* Also remove the _chdirU(app_dir) when using -i in commandline.
2023-04-24 20:50:53 +01:00
Pete Batard
3177e70e25 [misc] fix CodeQL warnings 2023-04-22 16:36:27 +01:00
Pete Batard
6280e8020a [net] fix incorrect architectures when querying for updates 2023-04-16 19:47:54 +01:00
Pete Batard
a0d669232c [ui] add a new selection dialog for Windows 11 setup customization
* This moves the extended Windows 11 options (bypass TPM & Secure Boot) away from
  "Image options" into a new explicit dialog, along with supplementary customization
  such as enabling offline account (for Windows 11 22H2) and skipping all data
  collection questions.
* This customization is now enacted through an unattend.xml file rather than offline
  registry manipulation, so that this *should* also work with the Windows Store version.
* Also update arch detection and rework/reorganize upcoming translation changes.
* Note: The 'Remove "unsupported hardware" desktop watermark' option is *UNTESTED*.
2022-06-23 13:34:24 +01:00
Pete Batard
c28f9bc491 [misc] fix PVS-Studio warnings 2022-01-05 12:57:26 +01:00
Dimitri Papadopoulos
d840083a32 [misc] fix typos found by codespell
* 3rd party software was left out.
* Most changes are in code comments, but one user-visible string has also been fixed.
* Closes #1817
2021-11-16 18:53:52 +00:00
Pete Batard
2761c72187 [parser] fix unwanted removal of lines that don't match a token
* In replace_in_token_data() when looking for lines starting with a specific
  token but finding lines containing a larger version of the token (e.g. looking
  for 'linux' but finding 'linux16') we would forget to output the non matching
  line as we rejected it.
* This produced issues such as the one described at:
  https://ubuntuforums.org/showthread.php?t=2465291&page=10&p=14052629#post14052629
* Fix this by ensuring that we always output the lines that we reject.
2021-09-20 16:11:47 +01:00
Pete Batard
8538ce0590 [misc] fix some Coverity warnings 2021-08-02 13:22:49 +01:00
Pete Batard
c8078b0119 [misc] fix Coverity warnings
* Also re-instate the _coverity.cmd script and try to fix AppVeyor Coverity uploads
2020-06-19 10:53:40 +01:00
Pete Batard
68d42d4153 [iso] remove Ubuntu's splash screen for persistent drives
* This is accomplished by removing the 'maybe-ubiquity' option
* UEFI only
2020-06-11 13:52:14 +01:00
Pete Batard
590b89a56a [parser] add multiple occurrence support to replace_in_token_data()
* Closes #1333
2020-03-23 17:49:40 +00:00
Tsarevich Dmitry
121257c584 [misc] fix PVS-Studio static analyzer warnings
* Surround macro params to ensure expected results
* Fix copy-paste errors
* Fix a potential buffer overflow in SetSectionHeaders()
* Add const modifier where relevant
* Use GetWindowLongPtr() everywhere
* Use proper sprintf format for unsigned int
* Use %s for printf-like funcs (https://www.viva64.com/en/w/v618/print/)
* Closes #1464
2020-02-28 17:08:11 +00:00
Pete Batard
4c816a519e [misc] update license URLs and align ms-sys's write_data buffer to 4K
* Also remove some obsolete TODOs
2019-09-06 11:32:37 +01:00
Pete Batard
1fa0aaf325 [iso] relax isolinux cfg file detection for persistence and force DD mode for Pop_OS 2019-08-15 21:14:30 +01:00
Pete Batard
4c8dd29935 [misc] silence more Coverity false positives
* "Show me static analysis framework that only triples my work and I will kiss its feet."
2019-08-06 17:02:28 +01:00
Pete Batard
84427d12dd [core] add an exception for JMicron flash drives
* Also fix another round of Coverity trigger-happy warnings (Seriously, those FALSE
  POSITIVES about fwprintf can £$%^&* off — fix your frigging detection, Synopsys!)
2019-08-05 20:18:34 +01:00
Pete Batard
fcb15ab6e9 [ext2fs] automated persistence set up for Debian Live & Ubuntu
* Only UEFI boot for now (GRUB) & requires a post 2019.07.26 ISO for Ubuntu.
* This adds the relevant persistence/persistent kernel option to the conf file, sets the
  expected volume label and creates a /persistence.conf file where needed.
* Also improve token parsing by ensuring a token is followed by at least one white space.
2019-08-02 17:57:10 +01:00
Pete Batard
0c368b4e69 [loc] finalize translations for 3.5
* Also update for latest Fido and simplify SetLGP
2019-03-12 19:53:25 +00:00
Pete Batard
6109d91c38 [net] add automated update support for ARM/ARM64 2018-10-22 17:42:40 +01:00
Pete Batard
0fa19d7019 [internal] reorganize localization resources 2018-07-16 16:38:40 +01:00
Pete Batard
f9275e4780 [loc] update the processing of version numbers
* Now only use major.minor for version references
* Drop the use of LOC_FRAMEWORK_VERSION. We'll use custom handling if we ever need a framework change.
* Also update/fix some of the UI elements for persistent partition
* Also reposition the language selection menu when we don't have a large number of them
2018-07-15 01:05:05 +01:00
Pete Batard
63eb747cde [iso] make the lookup for updatable .cfg file more generic
* For ESET and other ISOs, such as Arch derivatives
* Closes #1013
2017-11-01 12:30:29 +00:00
Pete Batard
9464ae94a4 [pki] more ASN.1 parser improvements 2017-09-05 22:21:34 +01:00
Pete Batard
94e4c0905b [pki] improve ASN.1 parser
* Enable search from OIDs expressed as strings and ignore non UNIVERSAL classes
2017-09-04 14:32:56 +01:00
Pete Batard
35da381a11 [pki] check timestamp chronology during update validation
* Done to address the second "vulnerability" proposed in #1009, independently
  of the protocol used.
2017-09-02 15:27:56 +01:00
Pete Batard
be1bdb7c85 [misc] miscellaneous cleanup
* Also add CreateWindowExU() method
* Also add the 'DisableFileIndexing' to the ini template
2017-04-04 17:26:45 +01:00
Pete Batard
edcfd43ed5 [misc] fix multiple VS Code Analysis warnings 2017-03-10 19:07:48 +01:00
Pete Batard
7d302d340f [togo] enable selection of Windows version
* Closes #847
* Also set rufus-next to 2.12
2016-12-13 14:26:27 +00:00
Pete Batard
a10ea1498b [misc] add more check for malloc() errors
* Closes #772
* With thanks to @elfring
2016-06-07 19:47:01 +01:00
Pete Batard
c3f47ada06 [misc] add missing.h header
* Also clean up code
2016-02-20 22:52:32 +00:00
Pete Batard
140236acd6 [loc] display a note in the log when a translation is behind
* Also make sure the messages regarding language pack availability
  are visible to the users in the log
* Also fix a typo in the Malay translation
2016-02-15 12:50:06 +00:00
Pete Batard
65bbe984fd [loc] remove nagging about lost translators
* All things considered, this was probably more detrimental than helpful
* Reverts 26af32b522
2016-02-05 13:14:22 +00:00