Commit Graph

99 Commits

Author SHA1 Message Date
Pete Batard 6dac531552
[misc] don't pass an output size in DeviceIoControl() when not needed
* Also improve partition creation and address 2 Coverity warnings.
2024-04-01 14:56:06 +01:00
Pete Batard 8a5a5a318a
[misc] improve readability of error code handling
* Also don't pass a read size value in WriteFileWithRetry() if we don't use it.
2024-04-01 02:16:41 +01:00
Pete Batard c2b2624b62
[vhd] improve handing of user selected filename on save to VHD/FFU
* Use of '*.*' as pattern in file save dialog could lead to assert and crash, so
  we now try to derive the type of image to be saved from the file extension. We
  also did not properly handle user cancellation in the file save dialog.
* Also update iso9660/iso9660_fs.c to latest proposal of El Torito image handling.
* Also add a couple asserts in the hash table functions so that, if these ever get
  triggered we will pick them from Windows Store reports, and clean up code.
2024-02-03 18:39:44 +00:00
Pete Batard 70e87482c1
[misc] add some more Windows edition names
* Closes #2380
* Also fix a typo in the Norwegian translation, with thanks to @Legendarion
* Closes #2397
2024-01-10 12:53:07 +00:00
Pete Batard 8edb487ac9
[misc] update ChangeLog for 4.3 BETA
* Also minor code cleanups and improvements.
2023-10-12 19:46:10 +01:00
Pete Batard 5b6574d6f6
[misc] add S Mode detection to Windows version reporting
* With thanks to @Wack0
2023-08-18 17:38:12 +01:00
Pete Batard 64e85ed09a
[uefi] don't revoke Windows 11 or post Windows 10 20H1 boot media yet
* As opposed to what we originally asserted, Microsoft did enact a blanket revocation
  in SkuSiPolicy.p7b for all post 1703 up to 2305 Windows UEFI bootloaders.
* As a result, unconditionally copying SkuSiPolicy.p7b will result in media as recent
  as Windows 11 22H2 (v1) being flagged as revoked, which we don't want to enforce as
  long as Microsoft themselves haven't entered the enforcing phase of their Black
  Lotus mitigation (currently planned for early 2024).
* Because of this, while we add some revocation detection for post 1703 bootloaders,
  we set it to only go as far as 20H1 for now, which means that all post 20H1 Windows
  10 media and all Windows 11 media will not yet be flagged by Rufus as revoked and
  will still boot in a Secure Boot environment due to lack of an SkuSiPolicy.p7b.
* Ultimately, per #2244 we may look for a BOOTMGRSECURITYVERSIONNUMBER resource to
  blanket revoke all post 1703 - pre 2305 Windows UEFI bootloaders.
* Also remove the now unused comdlg32 library from the linker.
2023-07-15 23:20:59 +02:00
Pete Batard 0b1c68635a
[vhd] add experimental save to Full Flash Update (FFU) image support
* Full Flash Update (FFU) image support was added to dism with Windows 10 1709
  and is an alternate way to save a virtual hard disk for restoration.
* While more modern than VHD/VHDX, FFU creation only works for drives with file
  systems that Windows natively recognizes (FAT, NTFS) and that look like Windows
  installation media, so you can forget about FFU'ing a Linux disk.
* The other *intentional* drawback that Microsoft added is that they don't want
  anybody but themselves being able to create and restore FFU images, so, even
  as they have nice FfuApplyImage()/FfuCaptureImage() calls in FfuProvider.dll
  they have decided not to make these public.
* This means that, since we don't have time to spend on figuring and direct
  hooking internal DLL calls for x86_32, x86_64, ARM and ARM64 (and worrying
  that Microsoft may ever so slightly change their DLL between revs to break
  our hooks), we just call on dism.exe behind the scenes to create the FFU.
2023-07-03 23:57:04 +01:00
Pete Batard 0df68b6af9
[misc] further Windows 7 specifics removals
* Also remove some unused code in stdlg.c
* Note that virtdisk appears to be a vulnerable library, so we go
  through delay loading yet again...
2023-04-28 17:46:05 +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 fffd4d1160
[misc] harden usage of uprintf()
* Passing a non-formatting buffer as first parameter of uprintf() can lead
  to an exception if this buffer happens to contain a '%' character, so
  usage of uprintf() with string buffers that may contain '%' should be
  sanitized.
* Also drop the _uprintf/_uprintfs aliases as they are no longer required.
2023-04-20 17:43:24 +01:00
Pete Batard a6451c6fc7
[misc] further Windows version and arch detection improvements
* Now also populate the underlying Windows arch in the version struct
* Also fix MinGW warnings
2023-04-18 17:32:47 +01:00
Pete Batard e5f90282ed
[misc] improve Windows version detection
* Also use actual Windows major.minor when checking for updates
2023-04-17 13:33:05 +01:00
Pete Batard 6280e8020a
[net] fix incorrect architectures when querying for updates 2023-04-16 19:47:54 +01:00
Pete Batard 1dc9fab917
[misc] add a cheat mode to preserve the log between sessions
* This new cheatmode (<Ctrl>-<P>) is mostly designed to help with development.
2023-01-13 21:49:57 +00:00
Pete Batard 9073962faf
[wue] add automatic local account creation and regional settings duplication
* Local account is created with the same name as the current user along with an *empty* password
  (which we force the user to change on next logon). This is done to assuage users who might be
  weary of entering a password in a third party application, and has the benefit of enabling
  autologon when the install is complete.
* Note that the creation of a local account through an answer file prevents Windows 11 22H2
  from bugging users about MSA *even with an active network connection*.
* For convenience reasons, only duplication of the current username is enabled. We *may* add a
  dialog to enter any random username in a future version, but for 3.20, this is all you get.
* Likewise, the locale duplication is only carried out during OOBE and *not* WinPE (which means
  that you still get the initial "Windows setup language and user preferences" prompt). This is
  intentional as otherwise the default screen and "Repair Windows" options are not presented.
* It's not my fault that the Windows password change screen is super ill conceived, whereas it
  doesn't hide the current password field as it should when the current password is blank, and
  one needs to click on a very small arrow to get the changes applied, instead of a PROMINENT
  button that should intuitively have been positioned right next to "Cancel".
* If you want to complain that we should just "present the user with XYZ and be done with it",
  please bear in mind that we can't add new dialogs to Rufus as willy-nilly as you believe we
  can. *ANY* new UI interface requires major planning, which is the reason why, for the time
  being, we are limited to reusing a simple dissociated list of checkboxes for all WUE options.
2022-07-19 19:11:06 +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 3aac3f5583
[misc] improve Windows edition reporting
* Closes #1808
* Also update rufus-next to 3.18
2021-10-27 09:51:28 +01:00
Pete Batard 05382d8c7d
[core] ReFS improvements
* Allow 4K/64K cluster size selection
* Only enable ReFS on relevant platforms
* Also recognize a few more Windows editions
2021-10-21 02:02:17 +01:00
Pete Batard d8a2c29a67
[core] fix MBR cleanup regression
* Commit 9dc045a701 introduced a regression on account that we didn't set the
  file pointer to 0 before clearing the disk.
* This leads to the MBR not being properly cleared, with the result that Windows may in turn
  produce errors when trying to repartition the disk.
* Fix this by making sure we do invoke SetFilePointerEx() before calling WriteFileWithRetry().
* Also set rufus-next to 3.17
* Also fix a MinGW warning
2021-10-17 13:35:31 +01:00
Pete Batard 0b618f3de7
[misc] misc improvements and fixes
* Remove BypassRAMCheck from Extended Windows 11 installation since the minimum
  RAM requirements for Windows 11 are 4 GB and not 8 GB as pointed out in #1791.
* Display Windows edition code when we can't resolve it.
* VS2019 wants us to have PackageOptionalProjectsInIdeBuilds enabled? So be it.
2021-10-15 13:13:36 +01:00
Pete Batard b043db33e6
[core] add option to bypass TPM 2.0/Secure Boot/RAM requirements for Windows 11 ISOs
* If 'Extended Windows 11 Installation' mode is selected, the system registry hive of
  'sources\boot.wim' is patched to add the Setup\LabConfig registry keys that bypass
  the TPM 2.0/Secure Boot/8GB+ RAM Windows 11 system requirements.
2021-10-08 19:24:10 +01:00
Pete Batard aba6c7d996
[misc] small Windows versioning improvement
* Actually define a WINDOWS_11 version and use it when Windows 11 is detected.
* Also some comment cleanup.
2021-09-28 15:39:51 +01:00
Pete Batard d203c91403
[core] report Windows edition
* Also use build number to detect Windows Server 2019 and Windows 11
  since Microsoft are COMPLETE ASSES about their version reporting.
* Also fix a compilation warning.
2021-09-26 16:20:46 +01:00
Pete Batard 2e1833e91e
[misc] improve CoInitialize calls
* Balance with CoUninitialize and add COINIT_DISABLE_OLE1DDE
* Also add /BREPRO linker flag for reproducible VS2019 release builds
2021-04-09 12:36:30 +01:00
Pete Batard b3caf638b6
[misc] miscellaneous code cleanup and fixes
* Don't use hDrive handle for longer than necessary
* Move all the popcount() function calls into missing.h
* Ensure that the thread_affinity[] array is properly sized
* Improve timeouts for conflicting process search
2020-09-09 17:00:39 +01:00
Pete Batard 3d1ec358b5
[core] improve protective MBR for GPT media
* Use the upgraded msg.bin MBR along with its more comprehensive message.
* Also fixes and issue in GetResource().
2020-02-19 19:51:32 +00:00
Pete Batard b8579c04da
[misc] add arbitrary buffer allocation to GetResource()
* If duplicate is TRUE and len is non-zero, then a buffer of len size,
  padded with zeroes, is allocated for the resource.
2020-02-19 12:43:05 +00:00
Pete Batard fa8be68c54
[misc] display Windows Update Build Revision (UBR) when available
Yet another link in the long chain of Microsoft making it UNFATHOMABLY DIFFICULT
to figure out what version of Windows an application is actually running on...
2019-11-14 22:43:24 +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 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 e073fb47b0
[net] add Windows retail ISO downloads
* This is accomplished through Fido (https://github.com/pbatard/Fido), a *SIGNED*
  PowerShell script, that is downloaded from GitHub and that resides in memory for
  the duration of a session.
* The reason we use a downloaded PS script, rather than an embedded on, is because:
  - Microsoft have regularly been changing the deal with regards to how retail ISOs
    can be downloaded, and not for the better, so we can't simply embed a static
    means of downloading ISOs and expect that to work forever.
  - By using an external script, we can immediately respond to whatever new means of
    *ANNOYING* their legitimate users Microsoft will come up with next, as well as
    make sure that, the minute a new retail version of Windows becomes available, it
    also becomes available for download in Rufus.
* Note that if you are concerned about downloading a remote PS script that is being
  run at the same level as an elevated application, you should understand that:
  - Only scripts downloaded from GitHub, from an account that is protected with 2FA,
    are allowed to run (i.e. someone would first have to steal a *physical* 2FA key
    to be in a position to upload a malicious script).
  - On top of this, only scripts that are signed with a separate private key (RSA +
    AES-256), that is itself also protected with a strong unique password which only
    a single person knows (and must manually enter each time they want to make a new
    version of the script available for download), are allowed to run.
  The above means that there's about as much chance for someone to manage to upload
  a malicious script on the GitHub servers, that Rufus would allow to run, as there
  is for someone to upload a malicious version of Rufus itself.
  Still, if you are paranoid and have concerns that, even as you can validate from
  its source that Rufus does not attempt to execute any remote script unless a user
  actively selected and clicked the DOWNLOAD button, you can also completely disable
  the remote script download feature, if you just set the update check to disabled
  (which, by the way, Rufus *EXPLICITLY* asks you to choose whether you want to
  enable or not, the very first time you run the application).
* Also remove _unlinkU() which duplicates what DeleteFileU() already does.
2019-03-02 23:34:32 +00:00
Pete Batard f98c243eb8
[iso] fix crash when opening Windows ISOs
* Closes #1268
* Issue was introduced in 521034da99 and has
  to do with VS2017's handling of static strings in RELEASE mode.
  Fix is to use a static char array instead.
* Also fix MinGw build warnings and increase process search timeout
2019-01-31 13:50:03 +00:00
Pete Batard 326ae54f45
[togo] add a notice about WppRecorder.sys BSOD with 1809 ISOs
* Also improve detection of build number
2019-01-30 17:15:25 +00:00
Pete Batard 081d7b3a0b
[misc] remove the need for endpoint duplication in RunCommand() 2019-01-30 00:21:50 +00:00
Pete Batard 336e24c8c7
[loc] drop GetMuiString() and use formal loc data instead
* Relying on system MUIs was too brittle and provides us with no guarantee
  that the translated messages we need will actually be there.
* Also fix space before question mark in French translation.
2019-01-09 15:53:44 +00:00
Pete Batard 7757cab3c5 [ui] fix possible truncation of short image path
* Closes #1233
* Also fix MinGW builds due to missing PROCESSOR_ARCHITECTURE_ARM64 define
2018-10-22 22:28:20 +01:00
Pete Batard 6109d91c38 [net] add automated update support for ARM/ARM64 2018-10-22 17:42:40 +01:00
Pete Batard 05f8400451 [misc] reorganize UI function calls into their own source
* Also fix ARM/ARM64 broken compilation due to missing __popcnt()
2018-07-06 05:46:36 +01:00
Pete Batard 8238de67e1 [ui] fix more potential notification message truncation
* Some Thai UTF-8 notification messages went over the buffer size limit we used for vsnprintf()
* Also, revert part of 645184f11e and use LRE+PDF marks instead:
  Don't handle in the code what is better handled in the loc file.
2018-06-08 16:29:41 +01:00
Pete Batard 645184f11e [ui] fix some unwanted display of LTR or RTL strings
* Some English messages could appear RTL in the log
* Folder paths with RTL strings could appear scrambled in the UI
2018-06-07 22:30:53 +01:00
Pete Batard 1dbbe69a4b [ui] improve partition scheme default selection
* Also rename our variable to PartitionStyle/ps for clarity
2018-03-26 19:06:55 +01:00
Pete Batard a44518355f [ui] UI redesign
* Better guide the user through the flow of operations
* Also follow a concept design by Fahad Al-Riyami
* Closes #117
2018-03-22 23:14:21 +00:00
Pete Batard 903ac993f2 [misc] remove no longer needed XP workarounds 2017-11-13 14:30:25 +00:00
ip_gpu fa94abcc8e [misc] fix a potential resource leak
* IsFontAvailable() could exit without releasing its 'hDC' handle resulting in a resource leak
* Fix V773 from PSV-Studio
* Closes #1050
2017-10-28 19:01:49 +01:00
Pete Batard 8286a0f63a [core] add a cheat mode to reset the current USB device (cycle port)
* Will not work on Vista, Windows 7 or Server 2008
* Also update Windows version info
2017-09-15 13:56:01 +01:00
Pete Batard 90dc847e24 [misc] add static_strcat & static_strcpy and use static_ calls wherever possible
* Also set Rufus next to 2.17 and fix a warning
2017-08-10 19:43:52 +01:00
Pete Batard b4a2c06a2e [ui] ask user if they want proceed when conflicting processes are found
* Rufus now checks for processes with handles opened on the drives/volumes before
  starting the format operation and asks the user if they want to continue.
* This mimics Windows' behaviour when formatting drives, and actually uses the
  same message as the one from shell32.dll.mui.
* Closes #773
2017-07-16 22:42:19 +01:00
Pete Batard d1927ac1ef [core] handle search improvements
* Fix memory leaks due to not releasing the heap
* Also speed up lookups by not reopening the same process twice in a row
* Also make the usb_debug variable global so we can use uuprintf everywhere
2017-04-29 17:14:16 +01:00
Pete Batard d5f6ddb653 [core] list potentially blocking processes on disk access error
* Using functionality from Process Hacker:
  https://github.com/processhacker2/processhacker2/
* Part of the #773 enhancement
* Also fix minor MinGW and WDK warnings
2017-04-27 23:06:42 +01:00