Commit Graph

63 Commits

Author SHA1 Message Date
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 8fb602b8ee
[mbr] use 80x25:16 text mode rather than 640x480:16 VGA mode
* This should produce the same output while improving compatibility with systems that have a broken VGA implementation.
* Also fix an LD error with newer gcc toolchains.
2022-07-04 15:08:55 +01:00
Pete Batard e7b66e7e4c
[mingw] use delay loading for DLLs that are subject to side loading
* This reverts much of commits f6ac559f4d and 1947266837
  so that we call the Windows APIs directly again, while ensuring that, by the time we load the DLLs,
  sideloading mitigation has already been applied by the application.
* This is a continuation of #1877, and should help prevent re-introducing side-loading issues when we
  link against new libraries, as well as allow us to drop some of the manual DLL hooking we've been
  doing to prevent it, to clean up the code.
* Note that this is a bit more complex than what the stackoverflow post suggests, because we need to
  create delayloaded libs for both 32-bit and 64-bit, which use a different calling convention and
  therefore need to use different .def files. So there's a lot of gymkhana involved, with Makefiles
  and whatnot, to get us there.
* Also simplify the use of CM_Get_DevNode_Registry_PropertyA() in dev.c since recent versions of
  MinGW now have support for it.
* Also fix 2 small issues in net.c (potential overflow) and format.c (memory leak).
2022-04-12 11:09:59 +01:00
Pete Batard 9aea069f84
[misc] update autotools support files 2021-03-25 23:57:34 +00:00
Pete Batard e987272287
[grub] update GRUB 2.04 core.img for Ubuntu 20.10 support
* GRUB have cherry-picked patches from the "BootHole" vulnerability fix at
  https://lists.gnu.org/archive/html/grub-devel/2020-07/msg00034.html and
  have applied them to their 2.04 GRUB loader.
* This results in breakage with "error: symbol 'grub_calloc' not found" when
  using the release GRUB 2.04 version of core.img.
* Therefore, we too cherry-picked some patches to apply on top of GRUB 2.04
  release to make our core.img compatible with Ubuntu 20.10.
* Closes #1616
* Also increase the maximum write stride for ms-sys to 64 KB (required to
  write the GRUB 2.05 bootloader which is larger than 32 KB) and update hash DB.
2020-09-16 13:59:06 +01:00
Pete Batard 4617f91e3b
[misc] introduce hImageOption and ComboBox_GetCurItemData() to simplify code
* Also add retry to ms-sys' write_sectors()
2020-07-17 21:51:15 +01:00
Pete Batard 2dd538b7cb
[core] fix MBR protective message overwriting the primary GPT
* We distractedly chose to populate the message from our protective MBR
  for GPT/UEFI-only boot media into the 4KB that directly followed the
  MBR, which of course is space that is being used by the primary GPT.
* This resulted on systems having to fall back to using the secondary
  GPT, which not all appear to be designed to do.
* Alter the code to ensure the protective message is written at LBA 34,
  after the primary GPT.
* Closes #1507
2020-04-13 17:05:33 +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 65523bbdf9
[misc] fix 32-bit arithmetic overflow operation warnings
* Also disable C28251 annotation warning
2020-02-12 17:23:23 +00:00
David Stumph 3c9acb0d3c
[misc] use $(srcdir) in Makefiles
* Picked from #1449
2020-02-10 12:08:04 +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 d4a663991b
[core] report write errors more explicitly
* Also issue a port cycle on ERROR_NOT_READY
* Also run a check for conflicting processes during write retries
2019-04-09 21:37:08 +01:00
Pete Batard 28c1d6eb31
[core] display a notice about Legacy in the protective MBR for GPT
* This should help Windows users who create a GPT/UEFI drive and try to use it in BIOS/Legacy
* Also make sure that we take into account the split space for both "SELECT" and "DOWNLOAD"
2019-03-16 13:12:08 +00:00
Pete Batard c5f4e5a2ee [misc] drop Clang support and move VS2017 project files to .vs 2017-11-11 15:41:04 +00:00
Pete Batard 9b5cd92029 [arm] add Visual Studio ARM64 compilation support
* Windows 10 ARM users *WILL* be able to run Rufus natively
  the very same day they got their new device!
2017-11-03 18:04:33 +00:00
Pete Batard 9cd04be529 [grub] update grub4dos to latest and add db entry for grub 2.03 2017-11-02 12:49:05 +00:00
Pete Batard 92d8ac26b0 v2.15 (build 1117) 2017-05-16 12:37:46 +01:00
Pete Batard 23d71ae0f1 [arm] add ARM compilation support (MSVC)
* Yay!
* Also remove unneeded stdint.h/stdbool.h/inttypes.h
2017-05-15 12:04:03 +01:00
Pete Batard 3d1b3bac40 [misc] update project files to VS2017 2017-05-12 12:08:17 +01:00
Pete Batard ee67019129 [misc] add .editorconfig
* Also update getopt project file to remove missing file
2017-03-14 18:44:14 +01:00
Pete Batard 8a491e9877 [misc] update Clang solution for VS2017 2017-03-09 12:37:53 +01:00
Robert McQueen 234b0a3fde [ms-sys] fix for detecting windows MBRs with localised messages
* Windows MBRs contain localised strings which mean the bytes between the
  executable code and the disk signature / partition table can change depending
  on locale. This patch adds lengths to reflect the offsets which are the same
  for every locale, and only compares these lengths when detecting existing
  Windows MBRs.
2016-09-21 17:37:16 +01:00
Pete Batard aa4baab194 [core] add a workaround for >1TB HDDs that mistakenly report short writes
* It appears that 1.5TB and 2TB HDDs, accessed trough some Seagate ow WD USB ↔ SATA
  controllers, can report that 0 bytes were written on WriteFile(), even though all
  the data was effectively written. 1TB HDDs, accessed through the same controller,
  do not report this issue. So add a workaround for that.
* Also see #787
2016-09-06 18:31:30 +01:00
pluto00987 ce8fbd9934 [misc] align ms-sys source with upstream
* This adds the (currently unused) fat32pe boot records
* Closes #801
2016-08-11 17:05:39 +02:00
Pete Batard b204065f88 [clang] use the July Clang/C2 framework VS2015 update 2016-07-21 15:58:11 +01:00
Pete Batard cee50bd189 [grub] update Grub4DOS 0.4.6a to latest
* Also update Changelog
2016-07-10 21:51:46 +01:00
Pete Batard e76f60a3e8 [misc] use the more univerasal _mm_alloc() instead of _aligned_malloc()
* Also ensure that our buffers are aligned
* Also remove the use of static buffers in ms-sys
2016-06-10 12:42:43 +01:00
Pete Batard 3b0c4e8083 add Clang/C2 support for Visual Studio (EXPERIMENTAL)
* When I say EXPERIMENTAL, I mean it!!
* Currently, opening an ISO9660 image fails with 'Could not access directory'
2016-06-04 18:57:55 +01:00
Pete Batard f0b13361be [msvc] harmonize compilation options 2016-06-04 17:50:16 +01:00
Pete Batard 35e02ae8ce [ms-sys] upgrade ms-sys to v2.5.2 2016-01-18 12:20:49 +00:00
Pete Batard b77561bb9b [ms-sys] update ms-sys to current
* NB: This includes an updated Syslinux MBR
2016-01-07 15:49:58 +00:00
Pete Batard 60e90f7cef [misc] fix VS2015 warnings when compiling ms-sys for x64
* Closes #637
2015-11-09 18:45:08 +00:00
Johannes Holzhäuer 387b1fbce7 [misc] do not declare _CRT_SECURE_NO_WARNINGS and use secure functions
* From NickPapagiorgio/rufus@c144d76852
2015-09-04 13:42:55 +01:00
Pete Batard 3839bf42ce v2.3 (build 709)
* Closes #476
* Also removes the stacksize warning during VS code analysis
2015-08-28 23:12:55 +01:00
Pete Batard 5004374277 [misc] update to VS2015 and fix VS code analysis issues
* Also update Bled to latest, as well as build scripts
* Note: Considering that Visual Studio 2015 is both freely and legally
  available for anyone who wants to use it to compile Rufus, starting
  with this commit, I will NOT be supporting any other version of Visual
  Studio but 2015.
2015-08-10 23:30:23 +01:00
Pete Batard 9e7b0bad89 [syslinux] add support for 4K sector size
* Also add 4K sector size support in ms-sys
2015-06-02 21:47:44 +01:00
Pete Batard 93d0cf7fbe [grub] update Grub4DOS to latest
* Closes #516
2015-05-28 19:14:53 +01:00
Pete Batard 1dc55596d5 [grub] update Grub4DOS to 0.4.6a
* Also fix Grub4DOS and Grub2.0 versioning issues
* Also ensures that operation gets canceled on missing download
* Also fix German translation and remove trailing whitespaces in .loc file
* Also fix inverted display status for VMWare disk detection
2015-02-16 22:29:23 +00:00
Pete Batard cf7e52e051 [misc] pocketful of enhancement and fixes - part 4
* Fix disappearance of "Start" button when selecting an ISO with
  no target (reported by Sopor)
* Add commented sample ini file
* Add AC_PROG_AR macro in configure.ac
* Update ChangeLog for BETA
2015-02-10 22:45:48 +00:00
Pete Batard b830c040d2 [misc] fix XP compatibility
* MinGW's gcc 4.9.2 seems to implement a broken "%lld" format 64 bit integer is
  followed by more variables and the app executes on XP => use PRI macros
* Also fix partition ID being ignored when using Rufus MBR
* Also fix some global vars shadowing and add other improvements
2015-01-28 23:22:11 +00:00
Pete Batard e72d6546d1 [misc] update MinGW build chain for msys2
* Use autoconf and automake 1.14
* reinstate parallel build flags
* Also fix MinGW warnings and errors
2014-12-15 18:42:21 +00:00
Pete Batard 4c8b022042 [internal] enable ALPHA/BETA from configure
* Pass --enable-alpha or --enable-beta to configure/_release.sh
2014-11-28 00:22:57 +00:00
Pete Batard b3947fc026 [grub] add Grub 2.0 support
* Also moves secondary Grub boot record as a resource
* Also fix a typo in README.txt and update signtool path
* Closes #340
2014-11-17 23:41:46 +00:00
Pete Batard 306191fb85 [grub] add Grub4DOS support
* Also adds some stubs for Grub 2.0
* Also add a note about VS2013 CE in the readme
* Addresses the first part of #340
2014-11-14 23:46:56 +00:00
Pete Batard ca5a9dde5f [misc] upgrade solution files for Visual Studio 2013 Community Edition
* Visual Studio 2013 is now free for Open Source developers, so make
  it our default.
* See http://www.visualstudio.com/news/vs2013-community-vs
2014-11-13 11:04:37 +00:00
Pete Batard b6bc17b7f4 [core] add KolibriOS support
* Closes #331
2014-05-15 21:17:12 +01:00
Pete Batard 573ea45640 [core] add support for bare ReactOS boot record installation
* A new "ReactOS" is now available under "Create a bootable disk" when running in advanced mode.
* Using this option will install the ReactOS bootblocks (MBR & FAT PBR) _only_.
  You can then copy freeldr.sys and freeldr.ini to make the drive bootable.
* Also move Rufus MBR installation to ms-sys, and remove mbr.bin resource.
* Also add Rufus MBR detection, remove duplicate records and display MBR type on drive detection
* Also move PBR and MBR analysis calls to drive.c and add a drive.h header
* Also make extraction of embedded loc file more robust
2014-01-05 01:39:41 +00:00
Pete Batard c544429606 [loc] use a single rufus.loc as translator base
* Remove the need to maintain a new_translation.loc
* Add a sed invocation to remove comments and unwanted stuff
  to generate a final embedded.loc
* Note: sed is only invoked for MinGW.
  MS compilers still embed the unmodified rufus.loc.
* Also fix a small bug when parsing the version.
2013-11-01 21:53:48 +00:00
Pete Batard cd5665881c [core] drive handling improvements
* Use IOCTL_DISK_UPDATE_PROPERTIES after partitioning
* Use IOCTL_DISK_DELETE_DRIVE_LAYOUT to invalidate partitions before formatting
* Fix handling of unpartitioned drives
* Increase delay after partitioning
* All of the above should help with the infamous #122
* Also fix display of error messages in ms-sys' file.c as well as stdio.c
* Also add commandline option -f to list fixed drives
2013-06-25 02:55:25 +01:00
Pete Batard ae43dfd721 [misc] switch to VS2012 2013-01-07 01:50:51 +00:00